Merge pull request #23 from sanmai/pr/2019/cs-fixer

Introduce PHP CS Fixer
This commit is contained in:
Alexey Kopytko 2019-12-26 11:59:47 +09:00 committed by GitHub
commit 07cd651c60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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: cache:
directories: directories:
- $HOME/.composer/cache - $HOME/.composer/cache
- build/cache
install: install:
- composer install --prefer-dist - composer install --prefer-dist
- mkdir -p build/cache
script: script:
- php vendor/bin/phpunit - 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" "pear/pear-core-minimal": "^1.10"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "<6.0" "phpunit/phpunit": "<6.0",
"friendsofphp/php-cs-fixer": "^2.16"
}, },
"autoload": { "autoload": {
"psr-0": { "psr-0": {