|
49 | 49 | ->setRules( |
50 | 50 | [ |
51 | 51 | // Basic ruleset is PSR 12 |
52 | | - '@PSR12' => true, |
| 52 | + '@PSR12' => true, |
53 | 53 | // Short array syntax |
54 | | - 'array_syntax' => ['syntax' => 'short'], |
55 | | - // Lists should not have a trailing comma like list($foo, $bar,) = ... |
56 | | - 'no_trailing_comma_in_list_call' => true, |
| 54 | + 'array_syntax' => ['syntax' => 'short'], |
| 55 | + // List of values separated by a comma is contained on a single line should not have a trailing comma like [$foo, $bar,] = ... |
| 56 | + 'no_trailing_comma_in_singleline' => true, |
57 | 57 | // Arrays on multiline should have a trailing comma |
58 | | - 'trailing_comma_in_multiline' => ['elements' => ['arrays']], |
| 58 | + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], |
59 | 59 | // Align elements in multiline array and variable declarations on new lines below each other |
60 | | - 'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space_minimal', '=' => 'align']], |
| 60 | + 'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space_minimal', '=' => 'align', '??=' => 'align']], |
61 | 61 | // The "No break" comment in switch statements |
62 | | - 'no_break_comment' => ['comment_text' => 'No break'], |
| 62 | + 'no_break_comment' => ['comment_text' => 'No break'], |
| 63 | + // Remove unused imports |
| 64 | + 'no_unused_imports' => true, |
| 65 | + // Classes from the global namespace should not be imported |
| 66 | + 'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false], |
| 67 | + // Alpha order imports |
| 68 | + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], |
| 69 | + // There should not be useless else cases |
| 70 | + 'no_useless_else' => true, |
| 71 | + // Native function invocation |
| 72 | + 'native_function_invocation' => ['include' => ['@compiler_optimized']], |
| 73 | + // Adds null to type declarations when parameter have a default null value |
| 74 | + 'nullable_type_declaration_for_default_null_value' => true, |
63 | 75 | ] |
64 | 76 | ) |
65 | 77 | ->setFinder($finder); |
|
0 commit comments