From 13197123c54700234dda3e3513d2c2ed1ee3219a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Thu, 23 Nov 2017 11:15:52 +0100 Subject: [PATCH 1/3] Sort dependencies definitions --- composer.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index b4371aaec..8316e5780 100644 --- a/composer.json +++ b/composer.json @@ -13,20 +13,23 @@ {"name": "Marco Pivetta", "email": "ocramius@gmail.com"} ], "minimum-stability": "dev", + "config": { + "sort-packages": true + }, "require": { "php": "^7.1", "ext-pdo": "*", + "doctrine/annotations": "~1.4", + "doctrine/cache": "~1.6", "doctrine/collections": "^1.4", + "doctrine/common": "^2.7.1", "doctrine/dbal": "^2.6", "doctrine/instantiator": "~1.1", - "doctrine/common": "^2.7.1", - "doctrine/cache": "~1.6", - "doctrine/annotations": "~1.4", "symfony/console": "~3.0|~4.0" }, "require-dev": { - "symfony/yaml": "~3.4|~4.0", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" From 2be1b7d0b8cc47e1061493de74ac22131e3e5031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Thu, 23 Nov 2017 11:26:33 +0100 Subject: [PATCH 2/3] Add configuration for PHPCS And execute it on Travis (allowing it to fail for now to prevent a lot of conflicts with `develop`). --- .gitattributes | 1 + .gitignore | 1 + .travis.yml | 5 +++++ composer.json | 2 ++ phpcs.xml.dist | 24 ++++++++++++++++++++++++ 5 files changed, 33 insertions(+) create mode 100644 phpcs.xml.dist diff --git a/.gitattributes b/.gitattributes index 6b4dc843e..c5a870fd0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,3 +10,4 @@ build.xml export-ignore CONTRIBUTING.md export-ignore phpunit.xml.dist export-ignore run-all.sh export-ignore +phpcs.xml.dist export-ignore diff --git a/.gitignore b/.gitignore index d2f5f6901..da7410292 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ lib/Doctrine/DBAL vendor/ composer.lock /tests/Doctrine/Performance/history.db +/.phpcs-cache diff --git a/.travis.yml b/.travis.yml index e55ea503c..c74cf36c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,6 +78,11 @@ jobs: before_script: wget https://phpbench.github.io/phpbench/phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar.pubkey script: php phpbench.phar run -l dots --report=default + - stage: Coding standard + php: nightly + script: + - ./vendor/bin/phpcs + allow_failures: - php: nightly diff --git a/composer.json b/composer.json index 8316e5780..fad4b22ff 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,9 @@ "symfony/console": "~3.0|~4.0" }, "require-dev": { + "doctrine/coding-standard": "^1.0", "phpunit/phpunit": "^6.0", + "squizlabs/php_codesniffer": "^3.1", "symfony/yaml": "~3.4|~4.0" }, "suggest": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 000000000..9ffa05d31 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,24 @@ + + + + + + + + + + + + lib + tests + tools + + */tests/Doctrine/Tests/Proxies/__CG__/* + + + + + */tests/* + + + From 984327d782968e507de0c08b8da8b784f135a4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Thu, 23 Nov 2017 11:29:39 +0100 Subject: [PATCH 3/3] Update PHPStan --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c74cf36c2..31a63d87c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,7 @@ jobs: env: DB=none before_script: - echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.7 symfony/console:^3.0 + - travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.8 symfony/console:^3.0 script: vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib - stage: Coverage