|
| 1 | +<?php |
| 2 | + |
| 3 | +// Share common rules between non-test and test files |
| 4 | +return [ |
| 5 | + // PSR12 from https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/4943 |
| 6 | + '@PSR2' => true, |
| 7 | + 'blank_line_after_opening_tag' => true, |
| 8 | + 'braces' => [ |
| 9 | + // Not-yet-implemented |
| 10 | + // 'allow_single_line_anonymous_class_with_empty_body' => true, |
| 11 | + ], |
| 12 | + 'compact_nullable_typehint' => true, |
| 13 | + 'declare_equal_normalize' => true, |
| 14 | + 'lowercase_cast' => true, |
| 15 | + 'lowercase_static_reference' => true, |
| 16 | + 'new_with_braces' => true, |
| 17 | + 'no_blank_lines_after_class_opening' => true, |
| 18 | + 'no_leading_import_slash' => true, |
| 19 | + 'no_whitespace_in_blank_line' => true, |
| 20 | + 'ordered_class_elements' => [ |
| 21 | + 'order' => [ |
| 22 | + 'use_trait', |
| 23 | + ], |
| 24 | + ], |
| 25 | + 'ordered_imports' => [ |
| 26 | + 'imports_order' => [ |
| 27 | + 'class', |
| 28 | + 'function', |
| 29 | + 'const', |
| 30 | + ], |
| 31 | + 'sort_algorithm' => 'alpha', |
| 32 | + ], |
| 33 | + 'return_type_declaration' => true, |
| 34 | + 'short_scalar_cast' => true, |
| 35 | + 'single_blank_line_before_namespace' => true, |
| 36 | + 'single_trait_insert_per_statement' => true, |
| 37 | + 'ternary_operator_spaces' => true, |
| 38 | + 'visibility_required' => [ |
| 39 | + 'elements' => [ |
| 40 | + 'const', |
| 41 | + 'method', |
| 42 | + 'property', |
| 43 | + ], |
| 44 | + ], |
| 45 | + |
| 46 | + // Further quality-of-life improvements |
| 47 | + 'array_syntax' => [ |
| 48 | + 'syntax' => 'short', |
| 49 | + ], |
| 50 | + 'concat_space' => [ |
| 51 | + 'spacing' => 'none', |
| 52 | + ], |
| 53 | + 'fully_qualified_strict_types' => true, |
| 54 | + 'native_function_invocation' => [ |
| 55 | + 'include' => [], |
| 56 | + 'strict' => true, |
| 57 | + ], |
| 58 | + 'no_unused_imports' => true, |
| 59 | + 'single_quote' => true, |
| 60 | + 'space_after_semicolon' => true, |
| 61 | + 'trailing_comma_in_multiline_array' => true, |
| 62 | + 'trim_array_spaces' => true, |
| 63 | + 'unary_operator_spaces' => true, |
| 64 | + 'whitespace_after_comma_in_array' => true, |
| 65 | +]; |
0 commit comments