|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +use Symfony\Component\Finder\Finder; |
| 6 | + |
| 7 | +$finder = Finder::create() |
| 8 | + ->name('/\\.php$/') |
| 9 | + ->in(__DIR__) |
| 10 | + ->notPath('vendor'); |
| 11 | + |
| 12 | +return (new PhpCsFixer\Config()) |
| 13 | + ->setUsingCache(false) |
| 14 | + ->setRiskyAllowed(true) |
| 15 | + ->setRules([ |
| 16 | + '@DoctrineAnnotation' => true, |
| 17 | + '@PSR12' => true, |
| 18 | + '@PHP81Migration' => true, |
| 19 | + '@PHP80Migration:risky' => true, |
| 20 | + '@PHPUnit84Migration:risky' => true, |
| 21 | + 'align_multiline_comment' => [ |
| 22 | + 'comment_type' => 'phpdocs_like', |
| 23 | + ], |
| 24 | + 'array_syntax' => ['syntax' => 'short'], |
| 25 | + 'binary_operator_spaces' => [ |
| 26 | + 'default' => 'single_space', |
| 27 | + 'operators' => [ |
| 28 | + '=>' => 'align_single_space_minimal', |
| 29 | + ], |
| 30 | + ], |
| 31 | + 'blank_line_before_statement' => [ |
| 32 | + 'statements' => ['if', 'try', 'return'], |
| 33 | + ], |
| 34 | + 'cast_spaces' => ['space' => 'none'], |
| 35 | + 'concat_space' => ['spacing' => 'one'], |
| 36 | + 'declare_equal_normalize' => ['space' => 'none'], |
| 37 | + 'declare_strict_types' => true, |
| 38 | + 'doctrine_annotation_array_assignment' => [ |
| 39 | + 'operator' => '=', |
| 40 | + ], |
| 41 | + 'dir_constant' => true, |
| 42 | + 'ereg_to_preg' => true, |
| 43 | + 'escape_implicit_backslashes' => [ |
| 44 | + 'double_quoted' => true, |
| 45 | + 'heredoc_syntax' => true, |
| 46 | + 'single_quoted' => true, |
| 47 | + ], |
| 48 | + 'explicit_indirect_variable' => true, |
| 49 | + 'explicit_string_variable' => true, |
| 50 | + 'function_typehint_space' => true, |
| 51 | + 'linebreak_after_opening_tag' => true, |
| 52 | + 'lowercase_cast' => true, |
| 53 | + 'magic_constant_casing' => true, |
| 54 | + 'modernize_types_casting' => true, |
| 55 | + 'native_function_casing' => true, |
| 56 | + 'new_with_braces' => true, |
| 57 | + 'no_alias_functions' => true, |
| 58 | + 'no_blank_lines_after_phpdoc' => true, |
| 59 | + 'no_empty_comment' => true, |
| 60 | + 'no_empty_phpdoc' => true, |
| 61 | + 'no_empty_statement' => true, |
| 62 | + 'no_extra_blank_lines' => true, |
| 63 | + 'no_leading_import_slash' => true, |
| 64 | + 'no_leading_namespace_whitespace' => true, |
| 65 | + 'no_mixed_echo_print' => [ |
| 66 | + 'use' => 'echo', |
| 67 | + ], |
| 68 | + 'no_multiline_whitespace_around_double_arrow' => true, |
| 69 | + 'no_null_property_initialization' => true, |
| 70 | + 'no_php4_constructor' => true, |
| 71 | + 'no_short_bool_cast' => true, |
| 72 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 73 | + 'no_superfluous_elseif' => true, |
| 74 | + 'no_spaces_after_function_name' => true, |
| 75 | + 'no_spaces_around_offset' => [ |
| 76 | + 'positions' => ['inside', 'outside'], |
| 77 | + ], |
| 78 | + 'no_spaces_inside_parenthesis' => true, |
| 79 | + 'no_trailing_comma_in_singleline' => true, |
| 80 | + 'no_unneeded_control_parentheses' => true, |
| 81 | + 'no_unused_imports' => true, |
| 82 | + 'no_useless_else' => true, |
| 83 | + 'no_useless_return' => true, |
| 84 | + 'no_whitespace_in_blank_line' => true, |
| 85 | + 'non_printable_character' => false, |
| 86 | + 'ordered_class_elements' => true, |
| 87 | + 'ordered_imports' => true, |
| 88 | + 'phpdoc_indent' => true, |
| 89 | + 'phpdoc_scalar' => true, |
| 90 | + 'short_scalar_cast' => true, |
| 91 | + 'single_line_comment_style' => true, |
| 92 | + 'phpdoc_no_access' => true, |
| 93 | + 'phpdoc_no_empty_return' => true, |
| 94 | + 'phpdoc_no_package' => true, |
| 95 | + 'phpdoc_trim' => true, |
| 96 | + 'phpdoc_types' => true, |
| 97 | + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 98 | + 'return_type_declaration' => ['space_before' => 'none'], |
| 99 | + 'single_quote' => [ |
| 100 | + 'strings_containing_single_quote_chars' => true, |
| 101 | + ], |
| 102 | + 'standardize_not_equals' => true, |
| 103 | + 'visibility_required' => true, |
| 104 | + 'ternary_operator_spaces' => true, |
| 105 | + 'whitespace_after_comma_in_array' => true, |
| 106 | + ]) |
| 107 | + ->setFinder($finder); |
0 commit comments