diff --git a/legacy/.gitignore b/legacy/.gitignore index 69471bea6..279935729 100644 --- a/legacy/.gitignore +++ b/legacy/.gitignore @@ -8,6 +8,10 @@ /tests/results.html /tests/test_results.xml +# Tools +/tools/ +.php-cs-fixer.cache + ## Github Composer .gitignore ## See https://github.com/github/gitignore/blob/master/Composer.gitignore ################################################################################ diff --git a/legacy/.php-cs-fixer.php b/legacy/.php-cs-fixer.php new file mode 100644 index 000000000..7e24cf328 --- /dev/null +++ b/legacy/.php-cs-fixer.php @@ -0,0 +1,15 @@ +in(__DIR__) + ->exclude('application/models/airtime/map') + ->exclude('application/models/airtime/om'); + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PhpCsFixer' => true, + 'concat_space' => ['spacing' => 'one'], + 'ordered_class_elements' => false, + 'yoda_style' => false, +]) + ->setFinder($finder); diff --git a/legacy/Makefile b/legacy/Makefile index 664e1d9d5..3bb5ac27f 100644 --- a/legacy/Makefile +++ b/legacy/Makefile @@ -1,4 +1,4 @@ -.PHONY: build +.PHONY: build php-cs-fixer SHELL = bash @@ -10,3 +10,10 @@ test: vendor build: composer install --no-progress --no-interaction --no-dev + +tools/php-cs-fixer: + mkdir -p tools/php-cs-fixer + composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer + +php-cs-fixer: tools/php-cs-fixer + tools/php-cs-fixer/vendor/bin/php-cs-fixer fix