From 8c2dcaee33d0ea1153c4b5931e3e1a7b2d8404df Mon Sep 17 00:00:00 2001 From: Vladimir Jimenez Date: Thu, 8 Feb 2018 14:26:35 -0800 Subject: [PATCH] Update php-cs-fixer configuration [ci skip] --- .gitignore | 2 ++ .php_cs | 44 ----------------------------------- .php_cs.dist | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 44 deletions(-) delete mode 100644 .php_cs create mode 100644 .php_cs.dist diff --git a/.gitignore b/.gitignore index e6d68c44..320260e5 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,8 @@ Thumbs.db *~ node_modules .sass-cache +.eyeglass_cache +.php_cs composer.phar # IDE files # diff --git a/.php_cs b/.php_cs deleted file mode 100644 index c1eefd58..00000000 --- a/.php_cs +++ /dev/null @@ -1,44 +0,0 @@ -in(array( - __DIR__ . '/app', - __DIR__ . '/controllers', - __DIR__ . '/migrations', - __DIR__ . '/models', - __DIR__ . '/src', - __DIR__ . '/tests' - )) - ->exclude('cache') -; - -return Symfony\CS\Config\Config::create() - ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) - ->fixers(array( - '-empty_return', - '-multiline_array_trailing_comma', - '-no_empty_lines_after_phpdocs', // Workaround for removed spaces before use declarations - '-phpdoc_no_empty_return', - '-phpdoc_no_package', - '-phpdoc_params', - '-phpdoc_separation', - '-phpdoc_short_description', - '-single_quote', - '-return', - '-unalign_equals', - 'align_double_arrow', - 'concat_with_spaces', - 'multiline_spaces_before_semicolon', - 'newline_after_open_tag', - 'ordered_use', - 'phpdoc_order' - )) - ->finder($finder) -; diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 00000000..cfb5b452 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,65 @@ +in('app') + ->in('controllers') + ->in('migrations') + ->in('models') + ->in('src') + ->in('tests') + ->exclude('cache') +; + +$licenseHeader = <<setRules([ + '@Symfony' => true, + 'array_syntax' => ['syntax' => 'short'], + 'concat_space' => ['spacing' => 'one'], + 'header_comment' => [ + 'header' => $licenseHeader, + 'commentType' => 'comment', + 'location' => 'after_open', + 'separate' => 'both', + ], + 'no_short_echo_tag' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_imports' => [ + 'sortAlgorithm' => 'alpha', + 'importsOrder' => [ + 'const', + 'class', + 'function', + ], + ], + 'phpdoc_add_missing_param_annotation' => ['only_untyped' => false], + 'phpdoc_order' => true, + 'php_unit_fqcn_annotation' => true, // @todo Change this when PHPUnit 6 is the new minimum version + 'ternary_to_null_coalescing' => false, // @todo Change this when PHP 7.0 is the minimum version + 'yoda_style' => [ + 'equal' => false, + 'identical' => false, + ], + ]) + ->setFinder($finder) + ;