From 0455e70ffe192f22400f56d06a72729795a2ce37 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 18 Feb 2020 08:47:39 +0545 Subject: [PATCH] Add cs-fixer infrastructure like other apps --- .gitignore | 3 +++ .php_cs.dist | 12 ++++++++++++ .travis.yml | 2 +- composer.json | 10 +++++++++- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .php_cs.dist diff --git a/.gitignore b/.gitignore index 0897e1f..d83683c 100755 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ vendor # IDE nbproject + +# Tests +.php_cs.cache diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..4aaf1d9 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,12 @@ +getFinder() + ->exclude('vendor') + ->in(__DIR__); +$config->setRules([ + '@PSR1' => true, + '@Symfony' => true +]); + +return $config; diff --git a/.travis.yml b/.travis.yml index e4ee047..8833320 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ before_script: script: - if [ $RUN_PHPSTAN == "FALSE" ]; then find Core -name "*.php" | xargs -n1 php -l; fi - - if [ $RUN_PHPSTAN == "FALSE" ]; then ./vendor/bin/sabre-cs-fixer fix . --dry-run --diff; fi + - if [ $RUN_PHPSTAN == "FALSE" ]; then php vendor/bin/php-cs-fixer fix --dry-run --diff; fi - if [ $RUN_PHPSTAN == "TRUE" ]; then php vendor/bin/phpstan.phar analyse Core html; fi cache: diff --git a/composer.json b/composer.json index 1f1a12c..5541744 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "symfony/yaml" : "^3.4" }, "require-dev" : { - "sabre/cs" : "~0.0.6" + "friendsofphp/php-cs-fixer": "~2.16.1" }, "replace" : { "jeromeschneider/baikal" : "self.version" @@ -33,5 +33,13 @@ }, "support" : { "source" : "https://github.com/sabre-io/Baikal" + }, + "scripts": { + "cs-fixer": [ + "php-cs-fixer fix" + ], + "test": [ + "composer cs-fixer" + ] } }