|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->in(__DIR__) |
| 5 | + ->exclude(['var', 'vendor']) |
| 6 | + ->files()->name('*.php') |
| 7 | +; |
| 8 | + |
| 9 | +$config = new PhpCsFixer\Config(); |
| 10 | +return $config |
| 11 | + ->setRules([ |
| 12 | + '@PSR12' => true, |
| 13 | + '@PSR12:risky' => true, |
| 14 | + '@PhpCsFixer' => true, |
| 15 | + '@PhpCsFixer:risky' => true, |
| 16 | + |
| 17 | + // Overrides for rules included in PhpCsFixer rule sets |
| 18 | + 'concat_space' => ['spacing' => 'one'], |
| 19 | + 'method_chaining_indentation' => false, |
| 20 | + 'multiline_whitespace_before_semicolons' => false, |
| 21 | + 'native_function_invocation' => ['include' => ['@all']], |
| 22 | + 'no_superfluous_phpdoc_tags' => false, |
| 23 | + 'no_unset_on_property' => false, |
| 24 | + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], |
| 25 | + 'php_unit_internal_class' => false, |
| 26 | + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], |
| 27 | + 'php_unit_test_class_requires_covers' => false, |
| 28 | + 'phpdoc_align' => false, |
| 29 | + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 30 | + 'single_line_comment_style' => false, |
| 31 | + 'trailing_comma_in_multiline' => ['elements' => ['arrays', 'arguments']], |
| 32 | + 'yoda_style' => false, |
| 33 | + 'php_unit_strict' => false, |
| 34 | + 'php_unit_test_annotation' => false, |
| 35 | + |
| 36 | + // Additional rules |
| 37 | + 'return_assignment' => false, |
| 38 | + 'date_time_immutable' => true, |
| 39 | + 'declare_strict_types' => true, |
| 40 | + 'global_namespace_import' => [ |
| 41 | + 'import_classes' => null, |
| 42 | + 'import_constants' => true, |
| 43 | + 'import_functions' => true, |
| 44 | + ], |
| 45 | + 'list_syntax' => ['syntax' => 'short'], |
| 46 | + 'heredoc_indentation' => ['indentation' => 'same_as_start'], |
| 47 | + 'mb_str_functions' => true, |
| 48 | + 'native_constant_invocation' => true, |
| 49 | + 'nullable_type_declaration_for_default_null_value' => true, |
| 50 | + 'static_lambda' => true, |
| 51 | + 'ternary_to_null_coalescing' => true, |
| 52 | + 'use_arrow_functions' => true, |
| 53 | + ]) |
| 54 | + ->setRiskyAllowed(true) |
| 55 | + ->setFinder($finder) |
| 56 | + ; |
0 commit comments