|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->in([__DIR__.'/src', __DIR__.'/tests']) |
| 5 | +; |
| 6 | +$config = new PhpCsFixer\Config(); |
| 7 | + |
| 8 | +return $config |
| 9 | + ->setRules([ |
| 10 | + '@Symfony' => true, |
| 11 | + '@Symfony:risky' => true, |
| 12 | + '@DoctrineAnnotation' => true, |
| 13 | + '@PHP80Migration' => true, |
| 14 | + '@PHP80Migration:risky' => true, |
| 15 | + '@PHPUnit75Migration:risky' => true, |
| 16 | + 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], |
| 17 | + 'multiline_comment_opening_closing' => true, |
| 18 | + 'array_syntax' => ['syntax' => 'short'], |
| 19 | + 'ordered_imports' => [ |
| 20 | + 'imports_order' => ['const', 'class', 'function'], |
| 21 | + ], |
| 22 | + 'ordered_class_elements' => true, |
| 23 | + 'native_function_invocation' => ['include' => ['@internal']], |
| 24 | + 'explicit_indirect_variable' => true, |
| 25 | + 'explicit_string_variable' => true, |
| 26 | + 'escape_implicit_backslashes' => true, |
| 27 | + 'mb_str_functions' => true, |
| 28 | + 'logical_operators' => true, |
| 29 | + 'php_unit_method_casing' => ['case' => 'snake_case'], |
| 30 | + 'php_unit_test_annotation' => ['style' => 'annotation'], |
| 31 | + 'no_unreachable_default_argument_value' => true, |
| 32 | + 'declare_strict_types' => false, |
| 33 | + 'void_return' => false, |
| 34 | + 'single_trait_insert_per_statement' => false, |
| 35 | + 'simple_to_complex_string_variable' => true, |
| 36 | + 'no_superfluous_phpdoc_tags' => [ |
| 37 | + 'allow_mixed' => true, |
| 38 | + 'allow_unused_params' => true, |
| 39 | + 'remove_inheritdoc' => true, |
| 40 | + ], |
| 41 | + 'phpdoc_to_comment' => false, |
| 42 | + 'function_declaration' => ['closure_function_spacing' => 'none', 'closure_fn_spacing' => 'none'], |
| 43 | + 'nullable_type_declaration_for_default_null_value' => true, |
| 44 | + 'phpdoc_types_order' => ['null_adjustment' => 'none', 'sort_algorithm' => 'none'], |
| 45 | + 'phpdoc_separation' => ['groups' => [ |
| 46 | + ['test', 'dataProvider'], |
| 47 | + ['template', 'implements', 'extends'], |
| 48 | + ['phpstan-type', 'phpstan-import-type'], |
| 49 | + ['deprecated', 'link', 'see', 'since'], |
| 50 | + ['author', 'copyright', 'license', 'source'], |
| 51 | + ['category', 'package', 'subpackage'], |
| 52 | + ['property', 'property-read', 'property-write'], |
| 53 | + ]], |
| 54 | + ]) |
| 55 | + ->setRiskyAllowed(true) |
| 56 | + ->setFinder($finder) |
| 57 | +; |
0 commit comments