| 1 |
<?php |
| 2 |
|
| 3 |
$config = (new PhpCsFixer\Config()) |
| 4 |
->setIndent(" ") |
| 5 |
->setLineEnding("\n") |
| 6 |
->setCacheFile(__DIR__ . '/.php-cs-fixer.cache') |
| 7 |
->setRiskyAllowed(true) |
| 8 |
->setRules([ |
| 9 |
'@PHP71Migration' => true, |
| 10 |
'@PHP73Migration' => false, |
| 11 |
'@PhpCsFixer' => true, |
| 12 |
'@PhpCsFixer:risky' => true, |
| 13 |
'@PSR12' => true, |
| 14 |
'@Symfony' => true, |
| 15 |
'@Symfony:risky' => true, |
| 16 |
'align_multiline_comment' => true, |
| 17 |
'array_indentation' => true, |
| 18 |
'array_syntax' => ['syntax' => 'short'], |
| 19 |
'combine_consecutive_issets' => true, |
| 20 |
'combine_consecutive_unsets' => true, |
| 21 |
'combine_nested_dirname' => true, |
| 22 |
'comment_to_phpdoc' => true, |
| 23 |
'compact_nullable_typehint' => true, |
| 24 |
'concat_space' => ['spacing' => 'one'], |
| 25 |
'escape_implicit_backslashes' => false, |
| 26 |
'fully_qualified_strict_types' => true, |
| 27 |
'linebreak_after_opening_tag' => true, |
| 28 |
'list_syntax' => ['syntax' => 'short'], |
| 29 |
'method_argument_space' => ['ensure_fully_multiline' => true], |
| 30 |
'native_constant_invocation' => true, |
| 31 |
'native_function_invocation' => true, |
| 32 |
'native_function_type_declaration_casing' => true, |
| 33 |
'no_alternative_syntax' => true, |
| 34 |
'no_multiline_whitespace_before_semicolons' => true, |
| 35 |
'no_null_property_initialization' => true, |
| 36 |
'no_short_echo_tag' => true, |
| 37 |
'no_superfluous_elseif' => true, |
| 38 |
'no_unneeded_control_parentheses' => true, |
| 39 |
'no_useless_else' => true, |
| 40 |
'no_useless_return' => true, |
| 41 |
'not_operator_with_space' => false, |
| 42 |
'not_operator_with_successor_space' => false, |
| 43 |
'ordered_class_elements' => true, |
| 44 |
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'const', 'function']], |
| 45 |
'ordered_interfaces' => true, |
| 46 |
'php_unit_ordered_covers' => true, |
| 47 |
'php_unit_set_up_tear_down_visibility' => true, |
| 48 |
'php_unit_strict' => true, |
| 49 |
'php_unit_test_class_requires_covers' => true, |
| 50 |
'phpdoc_add_missing_param_annotation' => true, |
| 51 |
'phpdoc_order' => true, |
| 52 |
'phpdoc_to_comment' => false, |
| 53 |
'phpdoc_types_order' => true, |
| 54 |
'pow_to_exponentiation' => true, |
| 55 |
'random_api_migration' => true, |
| 56 |
'return_assignment' => false, |
| 57 |
'simple_to_complex_string_variable' => true, |
| 58 |
'single_line_comment_style' => true, |
| 59 |
'single_trait_insert_per_statement' => true, |
| 60 |
'strict_comparison' => false, |
| 61 |
'strict_param' => false, |
| 62 |
'string_line_ending' => true, |
| 63 |
'yoda_style' => false, |
| 64 |
]) |
| 65 |
->setFinder( |
| 66 |
PhpCsFixer\Finder::create() |
| 67 |
->exclude('libs') |
| 68 |
->exclude('tests/Fixtures') |
| 69 |
->exclude('var') |
| 70 |
->exclude('vendor') |
| 71 |
->in(__DIR__) |
| 72 |
) |
| 73 |
; |
| 74 |
|
| 75 |
return $config; |