Introduce PHP CS Fixer

This commit is contained in:
Alexey Kopytko 2019-12-26 00:01:13 +09:00
parent 4155eb74fa
commit 298f3abe8e
No known key found for this signature in database
GPG Key ID: C2E9F3FB4871E4A8
3 changed files with 16 additions and 1 deletions

11
.php_cs.dist Normal file
View File

@ -0,0 +1,11 @@
<?php
return PhpCsFixer\Config::create()
->setRules([
'native_function_invocation' => null,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
)
;

View File

@ -12,9 +12,12 @@ php:
cache:
directories:
- $HOME/.composer/cache
- build/cache
install:
- composer install --prefer-dist
- mkdir -p build/cache
script:
- php vendor/bin/phpunit
- vendor/bin/php-cs-fixer --cache-file=build/cache/.php_cs.cache --diff --dry-run --stop-on-violation --verbose fix

View File

@ -36,7 +36,8 @@
"pear/pear-core-minimal": "^1.10"
},
"require-dev": {
"phpunit/phpunit": "<6.0"
"phpunit/phpunit": "<6.0",
"friendsofphp/php-cs-fixer": "^2.16"
},
"autoload": {
"psr-0": {