|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->exclude('vendor') |
| 5 | + ->exclude('tests') |
| 6 | + ->in(__DIR__) |
| 7 | +; |
| 8 | + |
| 9 | +return PhpCsFixer\Config::create() |
| 10 | + ->setRules([ |
| 11 | + 'align_multiline_comment' => [ |
| 12 | + 'comment_type' => 'phpdocs_only' |
| 13 | + ], |
| 14 | + 'array_indentation' => [], |
| 15 | + 'array_syntax' => [ |
| 16 | + 'syntax' => 'short' |
| 17 | + ], |
| 18 | + 'binary_operator_spaces' => [ |
| 19 | + 'default' => 'single_space' |
| 20 | + ], |
| 21 | + 'blank_line_before_statement' => [ |
| 22 | + 'statements' => [ |
| 23 | + 'if','return','while','for','foreach','do' |
| 24 | + ] |
| 25 | + ], |
| 26 | + 'blank_line_after_opening_tag' => true, |
| 27 | + 'blank_line_after_namespace' => true, |
| 28 | + 'elseif' => false, |
| 29 | + 'explicit_string_variable' => false, |
| 30 | + 'full_opening_tag' => true, |
| 31 | + 'fully_qualified_strict_types' => true, |
| 32 | + 'line_ending' => true, |
| 33 | + 'linebreak_after_opening_tag' => true, |
| 34 | + 'lowercase_cast' => true, |
| 35 | + 'lowercase_keywords' => true, |
| 36 | + 'lowercase_static_reference' => true, |
| 37 | + 'no_alternative_syntax' => true, |
| 38 | + 'no_blank_lines_after_class_opening' => true, |
| 39 | + 'no_blank_lines_after_phpdoc' => true, |
| 40 | + 'no_blank_lines_before_namespace' => true, |
| 41 | + 'no_closing_tag' => true, |
| 42 | + 'no_empty_comment' => true, |
| 43 | + 'no_empty_phpdoc' => true, |
| 44 | + 'no_empty_statement' => true, |
| 45 | + 'no_multiline_whitespace_around_double_arrow' => true, |
| 46 | + 'no_spaces_after_function_name' => true, |
| 47 | + 'no_spaces_inside_parenthesis' => true, |
| 48 | + 'no_unused_imports' => true, |
| 49 | + 'single_import_per_statement' => true, |
| 50 | + 'single_blank_line_at_eof' => true, |
| 51 | + 'no_whitespace_in_blank_line' => true, |
| 52 | + 'not_operator_with_space' => false, |
| 53 | + 'ordered_imports' => [ |
| 54 | + 'sort_algorithm' => 'alpha' |
| 55 | + ], |
| 56 | + 'ordered_class_elements' => [ |
| 57 | + 'sortAlgorithm' => 'alpha', |
| 58 | + 'order' => [ |
| 59 | + 'constant_public', |
| 60 | + 'constant_protected', |
| 61 | + 'constant_private', |
| 62 | + 'property_public', |
| 63 | + 'property_protected', |
| 64 | + 'property_private', |
| 65 | + 'construct', |
| 66 | + 'method_public', |
| 67 | + 'method_private' |
| 68 | + ] |
| 69 | + ], |
| 70 | + 'no_mixed_echo_print' => [ |
| 71 | + 'use' => 'echo' |
| 72 | + ], |
| 73 | + 'constant_case' => [ |
| 74 | + 'case' => 'lower' |
| 75 | + ], |
| 76 | + 'increment_style' => [ |
| 77 | + 'style' => 'post' |
| 78 | + ], |
| 79 | + 'concat_space' => [ |
| 80 | + 'spacing' => 'none' |
| 81 | + ], |
| 82 | + 'braces' => [ |
| 83 | + 'allow_single_line_closure' => false, |
| 84 | + 'position_after_functions_and_oop_constructs' => 'same', |
| 85 | + 'position_after_anonymous_constructs' => 'next', |
| 86 | + 'position_after_control_structures' => 'same' |
| 87 | + ], |
| 88 | + 'class_definition' => [ |
| 89 | + 'single_line' => true |
| 90 | + ] |
| 91 | + ]) |
| 92 | + ->setFinder($finder) |
| 93 | +; |
0 commit comments