1+ <?php
2+
3+ if (!file_exists (__DIR__ .'/src ' )) {
4+ exit (0 );
5+ }
6+
7+ $ finder = (new PhpCsFixer \Finder ())
8+ ->in (__DIR__ .'/src ' )
9+ ->in (__DIR__ .'/tests ' )
10+ ;
11+
12+ return (new PhpCsFixer \Config ())
13+ ->setRules (array (
14+ '@Symfony ' => true ,
15+ '@Symfony:risky ' => true ,
16+ 'protected_to_private ' => false ,
17+ 'array_indentation ' => true ,
18+ 'array_syntax ' => ['syntax ' => 'short ' ],
19+ 'combine_consecutive_unsets ' => true ,
20+ 'declare_strict_types ' => true ,
21+ 'dir_constant ' => true ,
22+ 'fully_qualified_strict_types ' => true ,
23+ 'linebreak_after_opening_tag ' => true ,
24+ 'mb_str_functions ' => true ,
25+ 'modernize_types_casting ' => true ,
26+ 'no_alternative_syntax ' => true ,
27+ 'no_null_property_initialization ' => true ,
28+ 'no_php4_constructor ' => true ,
29+ 'no_superfluous_elseif ' => true ,
30+ 'no_unreachable_default_argument_value ' => true ,
31+ 'no_useless_else ' => true ,
32+ 'no_useless_return ' => true ,
33+ 'ordered_class_elements ' => true ,
34+ 'ordered_imports ' => true ,
35+ 'phpdoc_order ' => true ,
36+ 'phpdoc_to_comment ' => false ,
37+ 'phpdoc_types_order ' => [
38+ 'null_adjustment ' => 'always_last ' ,
39+ 'sort_algorithm ' => 'none '
40+ ],
41+ 'php_unit_set_up_tear_down_visibility ' => true ,
42+ 'pow_to_exponentiation ' => true ,
43+ 'semicolon_after_instruction ' => true ,
44+ 'ternary_to_null_coalescing ' => true ,
45+ 'method_argument_space ' => [
46+ 'keep_multiple_spaces_after_comma ' => true ,
47+ 'on_multiline ' => 'ensure_fully_multiline ' ,
48+ 'after_heredoc ' => true ,
49+ ],
50+ 'phpdoc_annotation_without_dot ' => false ,
51+ 'phpdoc_var_without_name ' => false ,
52+ 'phpdoc_trim ' => true ,
53+ 'no_superfluous_phpdoc_tags ' => false ,
54+ 'single_line_throw ' => true ,
55+ 'header_comment ' => [
56+ 'header ' => <<<EOF
57+ This file is part of the Micro framework package.
58+
59+ (c) Stanislau Komar <[email protected] > 60+
61+ For the full copyright and license information, please view the LICENSE
62+ file that was distributed with this source code.
63+ EOF
64+ ]
65+ ))
66+ ->setRiskyAllowed (true )
67+ ->setFinder ($ finder );
0 commit comments