From ea3758216186262e85df84406a18c99003594eeb Mon Sep 17 00:00:00 2001 From: alex-chevski Date: Wed, 29 Nov 2023 17:33:17 +0300 Subject: [PATCH] Added .php-cs-fixer config --- .php-cs-fixer.php | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .php-cs-fixer.php diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..a331abc --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,67 @@ +setCacheFile(__DIR__ . '/storage/framework/cache/.php_cs') + ->setFinder( + Finder::create() + ->in([ + __DIR__ . '/public', + __DIR__ . '/config', + __DIR__ . '/app', + __DIR__ . '/bootstrap', + __DIR__ . '/database', + __DIR__ . '/routes', + // __DIR__ . '/storage', + __DIR__ . '/tests', + ]) + ->append([ + __FILE__, + ]) + ) + ->setRules([ + '@PSR12' => true, + '@PSR12:risky' => true, + '@PHP80Migration' => true, + '@PHP80Migration:risky' => true, + '@PHPUnit84Migration:risky' => true, + '@PhpCsFixer' => true, + '@PhpCsFixer:risky' => true, + + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const']], + + 'concat_space' => ['spacing' => 'one'], + 'cast_spaces' => ['space' => 'none'], + 'binary_operator_spaces' => false, + + 'phpdoc_to_comment' => false, + 'phpdoc_separation' => false, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last'], + 'phpdoc_align' => false, + + 'operator_linebreak' => false, + + 'global_namespace_import' => true, + + 'blank_line_before_statement' => false, + 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], + + 'fopen_flags' => ['b_mode' => true], + + 'php_unit_strict' => false, + 'php_unit_test_class_requires_covers' => false, + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + + 'yoda_style' => false, + + 'final_class' => false, + 'final_public_method_for_abstract_class' => true, + 'self_static_accessor' => true, + + 'static_lambda' => true, + ]);