From e4ddb8ac6cc943dbb789540b8833884f12d0ff48 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 4 Apr 2018 12:37:11 +0900 Subject: [PATCH 1/9] drop hhvm support --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 286edaf..ec9c7d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ php: - 5.6 - 7.0 - 7.1 - - hhvm cache: directories: - vendor From 9c7d471fdce7f4e699fd2bae4b1c2c932079d61e Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 4 Apr 2018 12:37:30 +0900 Subject: [PATCH 2/9] add php7.2 support --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index de9763c..9892f06 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,9 @@ "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0", - "squizlabs/php_codesniffer": "^2.8", - "friendsofphp/php-cs-fixer": "^2.3", + "phpunit/phpunit": "^5.7 || ^6.5", + "squizlabs/php_codesniffer": "^3.2", + "friendsofphp/php-cs-fixer": "^2.11", "phpmd/phpmd": "^2.6" }, "autoload": { From d97c658ee9342d340778ce514654d6d4f98fa2a7 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 4 Apr 2018 15:27:40 +0900 Subject: [PATCH 3/9] minimum version php 7.0+ --- composer.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 9892f06..9315893 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,10 @@ } ], "require": { - "php": ">=5.6.0" + "php": ">=7.0.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5", + "phpunit/phpunit": "^6.5", "squizlabs/php_codesniffer": "^3.2", "friendsofphp/php-cs-fixer": "^2.11", "phpmd/phpmd": "^2.6" @@ -46,8 +46,7 @@ "Koriym\\PhpSkeleton\\Installer::postInstall", "composer update" ], - "test": ["phpmd src text ./phpmd.xml", "@cs", "phpunit" - ], + "test": ["@cs", "phpmd src text ./phpmd.xml", "phpunit"], "coverage": ["php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage"], "cs": ["php-cs-fixer fix -v --dry-run", "phpcs --standard=./phpcs.xml src"], "cs-fix": ["php-cs-fixer fix -v", "phpcbf src"], From ee10383195221fb3427eee7d67c60dc4c53c85a5 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 4 Apr 2018 15:32:35 +0900 Subject: [PATCH 4/9] add phpstan --- README.md | 1 + composer.json | 5 +++-- phpstan.neon | 0 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 phpstan.neon diff --git a/README.md b/README.md index 0ff6e60..08e6742 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Various config files are ready for continuous integration. * .php_cs for [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) * .travis.yml for [Travis CI](https://travis-ci.org/) * .scrutinizer for [scrutinizer-ci](https://scrutinizer-ci.com/) + * phpstan.neon for [phpstan](https://github.com/phpstan/phpstan) ## Getting started diff --git a/composer.json b/composer.json index 9315893..d9c4edd 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ "phpunit/phpunit": "^6.5", "squizlabs/php_codesniffer": "^3.2", "friendsofphp/php-cs-fixer": "^2.11", - "phpmd/phpmd": "^2.6" + "phpmd/phpmd": "^2.6", + "phpstan/phpstan-shim" : "^0.9" }, "autoload": { "psr-4": { @@ -46,7 +47,7 @@ "Koriym\\PhpSkeleton\\Installer::postInstall", "composer update" ], - "test": ["@cs", "phpmd src text ./phpmd.xml", "phpunit"], + "test": ["@cs", "phpmd src text ./phpmd.xml", "phpstan analyse -l max src tests -c phpstan.neon --no-progress", "phpunit"], "coverage": ["php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage"], "cs": ["php-cs-fixer fix -v --dry-run", "phpcs --standard=./phpcs.xml src"], "cs-fix": ["php-cs-fixer fix -v", "phpcbf src"], diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..e69de29 From 28035ed6ab10d88b6550255f04b7354a7f016399 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 4 Apr 2018 15:32:46 +0900 Subject: [PATCH 5/9] update .tavis.yml --- .travis.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec9c7d3..28e35d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: php sudo: false dist: trusty php: - - 5.6 - - 7.0 + - 7 - 7.1 + - 7.2 cache: directories: - vendor @@ -16,9 +16,11 @@ env: before_script: - composer self-update - composer update $DEPENDENCIES + - if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then COVERAGE="--coverage-clover=coverage.clover"; else phpenv config-rm xdebug.ini; fi + - if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then composer require --dev phpstan/phpstan-shim friendsofphp/php-cs-fixer; fi script: - - ./vendor/bin/phpunit --coverage-clover=coverage.clover; - - if [ "$TRAVIS_PHP_VERSION" = "7.1" ]; then wget http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar && php php-cs-fixer-v2.phar fix --config=.php_cs -v --dry-run --using-cache=no --path-mode=intersection `git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE`; fi - + - ./vendor/bin/phpunit $COVERAGE; + - if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then IFS=$'\n'; COMMIT_SCA_FILES=($(git diff --name-only --diff-filter=ACMRTUXB "${TRAVIS_COMMIT_RANGE}")); unset IFS && ./vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --stop-on-violation --using-cache=no --path-mode=intersection -- "${COMMIT_SCA_FILES[@]}";fi + - if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then ./vendor/bin/phpstan analyse -l max -c phpstan.neon src tests --no-progress --no-interaction; fi after_script: - - if [ "$TRAVIS_PHP_VERSION" = "7.1" ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi + - if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi From ea5a258a8852b0b6f1b4497b061c3266ae091951 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 4 Apr 2018 16:02:52 +0900 Subject: [PATCH 6/9] remove package exception interface --- src/Exception/ExceptionInterface.php | 11 ----------- src/Exception/LogicException.php | 2 +- src/Exception/RuntimeException.php | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 src/Exception/ExceptionInterface.php diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php deleted file mode 100644 index ae1cfaa..0000000 --- a/src/Exception/ExceptionInterface.php +++ /dev/null @@ -1,11 +0,0 @@ - Date: Wed, 4 Apr 2018 16:08:11 +0900 Subject: [PATCH 7/9] remove tests/bootstrap.php --- phpunit.xml.dist | 2 +- tests/bootstrap.php | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 tests/bootstrap.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 80a10c1..0cc310d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,4 +1,4 @@ - + tests diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index fc7b2d1..0000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,4 +0,0 @@ - Date: Wed, 4 Apr 2018 16:08:19 +0900 Subject: [PATCH 8/9] remove parent::setUp(); --- tests/SkeletonTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/SkeletonTest.php b/tests/SkeletonTest.php index 4547c62..a5dbac4 100644 --- a/tests/SkeletonTest.php +++ b/tests/SkeletonTest.php @@ -12,7 +12,6 @@ class __Package__Test extends TestCase protected function setUp() { - parent::setUp(); $this->skeleton = new __Package__; } From b49bb7037be5cc288f6bec6575ab4fb365e80a84 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 4 Apr 2018 16:13:18 +0900 Subject: [PATCH 9/9] update meta files --- phpmd.xml | 33 +++++++++++++++++++-------------- phpunit.xml.dist | 5 ++++- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/phpmd.xml b/phpmd.xml index 8d48339..f5dd990 100644 --- a/phpmd.xml +++ b/phpmd.xml @@ -1,12 +1,24 @@ - - - + + + + + + + + + + + + + + + @@ -16,14 +28,10 @@ - + - - - - - + @@ -33,13 +41,10 @@ - - - - + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0cc310d..7829331 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,9 +1,12 @@ - + tests + + + src