use php cs fixer

This commit is contained in:
prolic 2018-06-29 18:12:40 +08:00
parent 92de8dc2a6
commit e20aa137bb
No known key found for this signature in database
GPG Key ID: 29722F9F48E9DE59
2 changed files with 21 additions and 0 deletions

10
.php_cs Normal file
View File

@ -0,0 +1,10 @@
<?php
$config = new Amp\CS\Config\Amp();
$config->getFinder()->in(__DIR__);
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
$config->setCacheFile($cacheDir . '/.php_cs.cache');
return $config;

View File

@ -13,6 +13,9 @@
"require": {
"amphp/amp": "^2"
},
"require-dev": {
"amphp/php-cs-fixer-config": "dev-master"
},
"autoload": {
"psr-4": {
"Amp\\Sql\\": "src"
@ -22,5 +25,13 @@
"platform": {
"php": "7.0.0"
}
},
"scripts": {
"check": [
"@cs",
"@test"
],
"cs": "php-cs-fixer fix -v --diff --dry-run",
"cs-fix": "php-cs-fixer fix -v --diff"
}
}