|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->in(__DIR__) |
| 5 | + ->exclude('tests/var/') |
| 6 | + ->exclude('vendor') |
| 7 | + ->files() |
| 8 | + ->name('*.php') |
| 9 | +; |
| 10 | + |
| 11 | +$config = PhpCsFixer\Config::create() |
| 12 | + ->setRiskyAllowed(true) |
| 13 | + ->setFinder($finder) |
| 14 | + ->setRules([ |
| 15 | + '@PSR2' => true, |
| 16 | + '@Symfony' => true, |
| 17 | + '@Symfony:risky' => true, |
| 18 | + 'align_multiline_comment' => ['comment_type' => 'all_multiline'], |
| 19 | + 'array_indentation' => true, |
| 20 | + 'array_syntax' => true, |
| 21 | + 'blank_line_before_return' => true, |
| 22 | + 'class_keyword_remove' => false, |
| 23 | + 'combine_consecutive_issets' => true, |
| 24 | + 'combine_consecutive_unsets' => true, |
| 25 | + 'comment_to_phpdoc' => true, |
| 26 | + 'compact_nullable_typehint' => true, |
| 27 | + 'date_time_immutable' => true, |
| 28 | + 'escape_implicit_backslashes' => [ |
| 29 | + 'double_quoted' => false, |
| 30 | + 'heredoc_syntax' => true, |
| 31 | + 'single_quoted' => true, |
| 32 | + ], |
| 33 | + 'explicit_indirect_variable' => true, |
| 34 | + 'explicit_string_variable' => true, |
| 35 | + 'final_internal_class' => true, |
| 36 | + 'fully_qualified_strict_types' => true, |
| 37 | + 'heredoc_to_nowdoc' => true, |
| 38 | + 'linebreak_after_opening_tag' => true, |
| 39 | + 'list_syntax' => true, |
| 40 | + 'mb_str_functions' => true, |
| 41 | + 'method_chaining_indentation' => true, |
| 42 | + 'multiline_comment_opening_closing' => true, |
| 43 | + 'multiline_whitespace_before_semicolons' => true, |
| 44 | + 'native_function_invocation' => true, |
| 45 | + 'no_alternative_syntax' => true, |
| 46 | + 'no_blank_lines_before_namespace' => false, |
| 47 | + 'no_null_property_initialization' => true, |
| 48 | + 'no_php4_constructor' => true, |
| 49 | + 'no_short_echo_tag' => true, |
| 50 | + 'no_superfluous_elseif' => true, |
| 51 | + 'no_unreachable_default_argument_value' => true, |
| 52 | + 'no_useless_else' => true, |
| 53 | + 'no_useless_return' => true, |
| 54 | + 'not_operator_with_space' => true, |
| 55 | + 'not_operator_with_successor_space' => true, |
| 56 | + 'ordered_class_elements' => true, |
| 57 | + 'ordered_imports' => true, |
| 58 | + 'php_unit_dedicate_assert' => [ |
| 59 | + 'target' => 'newest', |
| 60 | + ], |
| 61 | + 'php_unit_expectation' => true, |
| 62 | + 'php_unit_mock' => true, |
| 63 | + 'php_unit_namespaced' => true, |
| 64 | + 'php_unit_no_expectation_annotation' => true, |
| 65 | + 'php_unit_ordered_covers' => true, |
| 66 | + 'php_unit_strict' => true, |
| 67 | + 'php_unit_test_annotation' => true, |
| 68 | + 'php_unit_test_class_requires_covers' => true, |
| 69 | + 'phpdoc_add_missing_param_annotation' => [ |
| 70 | + 'only_untyped' => false, |
| 71 | + ], |
| 72 | + 'phpdoc_order' => true, |
| 73 | + 'phpdoc_types_order' => true, |
| 74 | + 'psr0' => true, |
| 75 | + 'simplified_null_return' => true, |
| 76 | + 'strict_comparison' => true, |
| 77 | + 'strict_param' => true, |
| 78 | + 'string_line_ending' => true, |
| 79 | + ]) |
| 80 | +; |
| 81 | + |
| 82 | +return $config; |
0 commit comments