|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = (new PhpCsFixer\Finder()) |
| 4 | + ->in(__DIR__) |
| 5 | + ->exclude(['var', 'vendor']) |
| 6 | +; |
| 7 | + |
| 8 | +return (new PhpCsFixer\Config()) |
| 9 | + ->setRules([ |
| 10 | + '@PSR12' => true, |
| 11 | + '@PHP80Migration' => true, |
| 12 | + '@DoctrineAnnotation' => true, |
| 13 | + 'align_multiline_comment' => true, |
| 14 | + 'array_indentation' => true, |
| 15 | + 'array_syntax' => ['syntax' => 'short'], |
| 16 | + 'binary_operator_spaces' => true, |
| 17 | + 'blank_line_after_opening_tag' => true, |
| 18 | + 'blank_line_before_statement' => true, |
| 19 | + 'cast_spaces' => ['space' => 'single'], |
| 20 | + 'class_attributes_separation' => true, |
| 21 | + 'combine_consecutive_issets' => true, |
| 22 | + 'combine_consecutive_unsets' => true, |
| 23 | + 'compact_nullable_typehint' => true, |
| 24 | + 'concat_space' => ['spacing' => 'none'], |
| 25 | + 'declare_equal_normalize' => ['space' => 'none'], |
| 26 | + 'declare_strict_types' => true, |
| 27 | + 'dir_constant' => true, |
| 28 | + 'ereg_to_preg' => true, |
| 29 | + 'explicit_indirect_variable' => true, |
| 30 | + 'explicit_string_variable' => true, |
| 31 | + 'final_internal_class' => true, |
| 32 | + 'fully_qualified_strict_types' => true, |
| 33 | + 'function_to_constant' => true, |
| 34 | + 'function_typehint_space' => true, |
| 35 | + 'include' => true, |
| 36 | + 'is_null' => true, |
| 37 | + 'linebreak_after_opening_tag' => true, |
| 38 | + 'list_syntax' => ['syntax' => 'short'], |
| 39 | + 'lowercase_cast' => true, |
| 40 | + 'lowercase_static_reference' => true, |
| 41 | + 'magic_constant_casing' => true, |
| 42 | + 'magic_method_casing' => true, |
| 43 | + 'mb_str_functions' => false, |
| 44 | + 'method_chaining_indentation' => true, |
| 45 | + 'multiline_comment_opening_closing' => true, |
| 46 | + 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], |
| 47 | + 'modernize_types_casting' => true, |
| 48 | + 'native_constant_invocation' => ['scope' => 'all'], |
| 49 | + 'native_function_casing' => true, |
| 50 | + 'native_function_invocation' => ['include' => ['@all']], |
| 51 | + 'new_with_braces' => true, |
| 52 | + 'no_alias_functions' => true, |
| 53 | + 'no_alternative_syntax' => true, |
| 54 | + 'no_binary_string' => true, |
| 55 | + 'no_blank_lines_after_class_opening' => true, |
| 56 | + 'no_blank_lines_after_phpdoc' => true, |
| 57 | + 'no_empty_comment' => true, |
| 58 | + 'no_empty_phpdoc' => true, |
| 59 | + 'no_empty_statement' => true, |
| 60 | + 'no_leading_import_slash' => true, |
| 61 | + 'no_mixed_echo_print' => ['use' => 'echo'], |
| 62 | + 'no_multiline_whitespace_around_double_arrow' => true, |
| 63 | + 'no_null_property_initialization' => false, |
| 64 | + 'no_short_bool_cast' => true, |
| 65 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 66 | + 'no_spaces_after_function_name' => true, |
| 67 | + 'no_spaces_around_offset' => true, |
| 68 | + 'no_spaces_inside_parenthesis' => true, |
| 69 | + 'no_superfluous_elseif' => true, |
| 70 | + 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], |
| 71 | + 'no_trailing_comma_in_list_call' => true, |
| 72 | + 'no_trailing_comma_in_singleline_array' => true, |
| 73 | + 'no_unneeded_control_parentheses' => true, |
| 74 | + 'no_unneeded_curly_braces' => true, |
| 75 | + 'no_unneeded_final_method' => true, |
| 76 | + 'no_unreachable_default_argument_value' => false, |
| 77 | + 'no_unused_imports' => true, |
| 78 | + 'no_useless_else' => true, |
| 79 | + 'no_useless_return' => true, |
| 80 | + 'no_whitespace_before_comma_in_array' => true, |
| 81 | + 'no_whitespace_in_blank_line' => true, |
| 82 | + 'non_printable_character' => false, |
| 83 | + 'object_operator_without_whitespace' => true, |
| 84 | + 'ordered_class_elements' => true, |
| 85 | + 'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const']], |
| 86 | + 'phpdoc_no_access' => true, |
| 87 | + 'phpdoc_no_empty_return' => true, |
| 88 | + 'phpdoc_no_package' => true, |
| 89 | + 'phpdoc_no_useless_inheritdoc' => true, |
| 90 | + 'phpdoc_return_self_reference' => true, |
| 91 | + 'phpdoc_scalar' => true, |
| 92 | + 'phpdoc_single_line_var_spacing' => true, |
| 93 | + 'phpdoc_to_comment' => false, |
| 94 | + 'phpdoc_types' => true, |
| 95 | + 'phpdoc_var_without_name' => true, |
| 96 | + 'increment_style' => ['style' => 'post'], |
| 97 | + 'return_type_declaration' => true, |
| 98 | + 'semicolon_after_instruction' => true, |
| 99 | + 'short_scalar_cast' => true, |
| 100 | + 'single_blank_line_before_namespace' => true, |
| 101 | + 'single_line_comment_style' => false, |
| 102 | + 'single_quote' => true, |
| 103 | + 'space_after_semicolon' => true, |
| 104 | + 'standardize_not_equals' => true, |
| 105 | + 'static_lambda' => true, |
| 106 | + 'strict_comparison' => true, |
| 107 | + 'strict_param' => true, |
| 108 | + 'ternary_operator_spaces' => true, |
| 109 | + 'trim_array_spaces' => true, |
| 110 | + 'unary_operator_spaces' => true, |
| 111 | + 'void_return' => true, |
| 112 | + 'whitespace_after_comma_in_array' => true, |
| 113 | + ]) |
| 114 | + ->setRiskyAllowed(true) |
| 115 | + ->setUsingCache(true) |
| 116 | + ->setCacheFile(__DIR__.'/.php-cs.cache') |
| 117 | + ->setIndent(' ') |
| 118 | + ->setLineEnding("\n") |
| 119 | + ->setFinder($finder) |
| 120 | +; |
0 commit comments