diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..a9a9d32 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,72 @@ +in(__DIR__) + ->exclude(['vendor', 'snippets']) +; + +$config = new PhpCsFixer\Config(); + +$config->setUsingCache(true) + ->setRiskyAllowed(true) + ->setFinder($finder); + +return $config->setRules([ + 'array_indentation' => true, + 'array_syntax' => ['syntax' => 'short'], + 'binary_operator_spaces' => ['default' => 'align', 'operators' => ['=>' => 'align', '=' => 'align_single_space']], + 'blank_line_after_namespace' => true, + 'blank_line_after_opening_tag' => true, + 'declare_strict_types' => true, + 'header_comment' => ['header' => $header], + 'indentation_type' => true, + 'linebreak_after_opening_tag' => true, + 'constant_case' => true, + 'lowercase_keywords' => true, + 'class_attributes_separation' => ['elements' => ['method' => 'one']], + 'native_function_invocation' => ['include' => ['@compiler_optimized']], + 'no_alias_functions' => true, + 'no_closing_tag' => true, + 'no_extra_blank_lines' => [ + 'tokens' => [ + 'break', + 'continue', + 'curly_brace_block', + 'extra', + 'parenthesis_brace_block', + 'return', + 'square_brace_block', + 'throw', + 'use', + ], + ], + 'echo_tag_syntax' => ['format' => 'long'], + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_imports' => true, + 'phpdoc_add_missing_param_annotation' => true, + 'phpdoc_order' => true, + 'semicolon_after_instruction' => true, + 'visibility_required' => [ + 'elements' => ['method', 'property', 'const'] + ], +]) +; diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 18f65be..0000000 --- a/.php_cs +++ /dev/null @@ -1,66 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => ['align_double_arrow' => true, 'align_equals' => true], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => true, - 'declare_strict_types' => true, - 'header_comment' => ['header' => $header], - 'indentation_type' => true, - 'linebreak_after_opening_tag' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'method_separation' => true, - 'native_function_invocation' => ['include' => ['@compiler_optimized']], - 'no_alias_functions' => true, - 'no_closing_tag' => true, - 'no_extra_consecutive_blank_lines' => [ - 'tokens' => [ - 'break', - 'continue', - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'return', - 'square_brace_block', - 'throw', - 'use', - ], - ], - 'no_short_echo_tag' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_order' => true, - 'semicolon_after_instruction' => true, - 'visibility_required' => true, - ]) - ->setUsingCache(true) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(['src', 'tests']) - ) -; diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b960c5..932ec22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ CHANGELOG master ------ -* todo +* Fix deprecated PHP-CS rules v0.4.0 ------