1
0
mirror of synced 2025-03-14 00:26:08 +03:00

Merge pull request #6844 from lcobucci/configure-phpcs

Configure PHPCS
This commit is contained in:
Luís Cobucci 2017-11-23 13:30:18 +01:00 committed by GitHub
commit ba32237e2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 6 deletions

1
.gitattributes vendored
View File

@ -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

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ lib/Doctrine/DBAL
vendor/
composer.lock
/tests/Doctrine/Performance/history.db
/.phpcs-cache

View File

@ -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
@ -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

View File

@ -13,20 +13,25 @@
{"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"
"doctrine/coding-standard": "^1.0",
"phpunit/phpunit": "^6.0",
"squizlabs/php_codesniffer": "^3.1",
"symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"symfony/yaml": "If you want to use YAML Metadata Mapping Driver"

24
phpcs.xml.dist Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruleset>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors" />
<!-- Ignore warnings and show progress of the run -->
<arg value="np"/>
<file>lib</file>
<file>tests</file>
<file>tools</file>
<exclude-pattern>*/tests/Doctrine/Tests/Proxies/__CG__/*</exclude-pattern>
<rule ref="Doctrine" />
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
</ruleset>