|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->notPath('config') |
| 5 | + ->notPath('vendor') |
| 6 | + ->in(__DIR__) |
| 7 | + ->name('*.php') |
| 8 | + ->notName('*.blade.php') |
| 9 | + ->ignoreDotFiles(true) |
| 10 | + ->ignoreVCS(true); |
| 11 | + |
| 12 | +return PhpCsFixer\Config::create() |
| 13 | + ->setRules( |
| 14 | + [ |
| 15 | + 'psr0' => false, |
| 16 | + '@PSR2' => true, |
| 17 | + 'align_multiline_comment' => true, |
| 18 | + 'array_indentation' => true, |
| 19 | + 'array_syntax' => [ |
| 20 | + 'syntax' => 'short', |
| 21 | + ], |
| 22 | + 'blank_line_after_opening_tag' => true, |
| 23 | + 'blank_line_before_statement' => [ |
| 24 | + 'statements' => [ |
| 25 | + 'break', |
| 26 | + 'case', |
| 27 | + 'continue', |
| 28 | + 'for', |
| 29 | + 'foreach', |
| 30 | + 'if', |
| 31 | + 'return', |
| 32 | + 'switch', |
| 33 | + 'throw', |
| 34 | + 'try', |
| 35 | + 'while', |
| 36 | + ], |
| 37 | + ], |
| 38 | + 'braces' => true, |
| 39 | + 'cast_spaces' => [ |
| 40 | + 'space' => 'single', |
| 41 | + ], |
| 42 | + 'class_definition' => true, |
| 43 | + 'combine_consecutive_issets' => true, |
| 44 | + 'combine_consecutive_unsets' => true, |
| 45 | + 'compact_nullable_typehint' => true, |
| 46 | + 'concat_space' => [ |
| 47 | + 'spacing' => 'one', |
| 48 | + ], |
| 49 | + 'dir_constant' => true, |
| 50 | + 'function_to_constant' => true, |
| 51 | + 'function_typehint_space' => true, |
| 52 | + 'increment_style' => [ |
| 53 | + 'style' => 'post', |
| 54 | + ], |
| 55 | + 'is_null' => true, |
| 56 | + 'linebreak_after_opening_tag' => true, |
| 57 | + 'logical_operators' => true, |
| 58 | + 'lowercase_cast' => true, |
| 59 | + 'lowercase_static_reference' => true, |
| 60 | + 'magic_constant_casing' => true, |
| 61 | + 'method_argument_space' => [ |
| 62 | + 'on_multiline' => 'ensure_fully_multiline', |
| 63 | + ], |
| 64 | + 'method_chaining_indentation' => true, |
| 65 | + 'modernize_types_casting' => true, |
| 66 | + 'native_constant_invocation' => true, |
| 67 | + 'native_function_casing' => true, |
| 68 | + 'native_function_invocation' => true, |
| 69 | + 'new_with_braces' => true, |
| 70 | + 'no_alias_functions' => true, |
| 71 | + 'no_blank_lines_after_class_opening' => true, |
| 72 | + 'no_blank_lines_after_phpdoc' => true, |
| 73 | + 'no_empty_phpdoc' => true, |
| 74 | + 'no_empty_statement' => true, |
| 75 | + 'no_extra_blank_lines' => true, |
| 76 | + 'no_leading_import_slash' => true, |
| 77 | + 'no_mixed_echo_print' => true, |
| 78 | + 'no_multiline_whitespace_around_double_arrow' => true, |
| 79 | + 'no_null_property_initialization' => true, |
| 80 | + 'no_short_bool_cast' => true, |
| 81 | + 'no_short_echo_tag' => true, |
| 82 | + 'no_spaces_after_function_name' => true, |
| 83 | + 'no_spaces_inside_parenthesis' => true, |
| 84 | + 'no_superfluous_elseif' => true, |
| 85 | + 'no_trailing_comma_in_singleline_array' => true, |
| 86 | + 'no_trailing_whitespace' => true, |
| 87 | + 'no_trailing_whitespace_in_comment' => true, |
| 88 | + 'no_unneeded_control_parentheses' => true, |
| 89 | + 'no_unused_imports' => true, |
| 90 | + 'no_useless_else' => true, |
| 91 | + 'no_useless_return' => true, |
| 92 | + 'no_whitespace_before_comma_in_array' => true, |
| 93 | + 'ordered_imports' => true, |
| 94 | + 'phpdoc_align' => true, |
| 95 | + 'phpdoc_scalar' => true, |
| 96 | + 'protected_to_private' => true, |
| 97 | + 'return_type_declaration' => true, |
| 98 | + 'set_type_to_cast' => true, |
| 99 | + 'simplified_null_return' => true, |
| 100 | + 'single_blank_line_at_eof' => true, |
| 101 | + 'single_class_element_per_statement' => [ |
| 102 | + 'elements' => ['property'], |
| 103 | + ], |
| 104 | + 'single_import_per_statement' => true, |
| 105 | + 'single_line_after_imports' => true, |
| 106 | + 'switch_case_semicolon_to_colon' => true, |
| 107 | + 'switch_case_space' => true, |
| 108 | + 'ternary_to_null_coalescing' => true, |
| 109 | + 'trailing_comma_in_multiline_array' => true, |
| 110 | + 'visibility_required' => [ |
| 111 | + 'elements' => ['property', 'method', 'const'], |
| 112 | + ], |
| 113 | + 'yoda_style' => false, |
| 114 | + ] |
| 115 | + ) |
| 116 | + ->setRiskyAllowed(true) |
| 117 | + ->setFinder($finder); |
0 commit comments