|
| 1 | +<?php |
| 2 | + |
| 3 | +$config = PhpCsFixer\Config::create() |
| 4 | + ->setRiskyAllowed(true) |
| 5 | + ->setRules([ |
| 6 | + '@PSR2' => true, |
| 7 | + 'array_syntax' => ['syntax' => 'short'], |
| 8 | + 'binary_operator_spaces' => ['operators' => ['=>' => null]], |
| 9 | + 'blank_line_after_opening_tag' => true, |
| 10 | + 'class_attributes_separation' => ['elements' => ['method']], |
| 11 | + 'compact_nullable_typehint' => true, |
| 12 | + 'concat_space' => ['spacing' => 'one'], |
| 13 | + 'declare_equal_normalize' => ['space' => 'none'], |
| 14 | + 'declare_strict_types' => false, |
| 15 | + 'dir_constant' => true, |
| 16 | + 'final_static_access' => true, |
| 17 | + 'fully_qualified_strict_types' => true, |
| 18 | + 'function_to_constant' => true, |
| 19 | + 'function_typehint_space' => true, |
| 20 | + 'header_comment' => false, |
| 21 | + 'is_null' => ['use_yoda_style' => false], |
| 22 | + 'list_syntax' => ['syntax' => 'short'], |
| 23 | + 'lowercase_cast' => true, |
| 24 | + 'magic_method_casing' => true, |
| 25 | + 'modernize_types_casting' => true, |
| 26 | + 'multiline_comment_opening_closing' => true, |
| 27 | + 'native_constant_invocation' => true, |
| 28 | + 'no_alias_functions' => true, |
| 29 | + 'no_alternative_syntax' => true, |
| 30 | + 'no_blank_lines_after_phpdoc' => true, |
| 31 | + 'no_empty_comment' => true, |
| 32 | + 'no_empty_phpdoc' => true, |
| 33 | + 'no_extra_blank_lines' => true, |
| 34 | + 'no_leading_import_slash' => true, |
| 35 | + 'no_leading_namespace_whitespace' => true, |
| 36 | + 'no_spaces_around_offset' => true, |
| 37 | + 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], |
| 38 | + 'no_trailing_comma_in_singleline_array' => true, |
| 39 | + 'no_unneeded_control_parentheses' => true, |
| 40 | + 'no_unset_cast' => true, |
| 41 | + 'no_unused_imports' => true, |
| 42 | + 'no_useless_else' => true, |
| 43 | + 'no_useless_return' => true, |
| 44 | + 'no_whitespace_in_blank_line' => true, |
| 45 | + 'normalize_index_brace' => true, |
| 46 | + 'ordered_imports' => true, |
| 47 | + 'php_unit_construct' => true, |
| 48 | + 'php_unit_dedicate_assert' => ['target' => 'newest'], |
| 49 | + 'php_unit_dedicate_assert_internal_type' => ['target' => 'newest'], |
| 50 | + 'php_unit_expectation' => ['target' => 'newest'], |
| 51 | + 'php_unit_mock' => ['target' => 'newest'], |
| 52 | + 'php_unit_mock_short_will_return' => true, |
| 53 | + 'php_unit_no_expectation_annotation' => ['target' => 'newest'], |
| 54 | + 'php_unit_test_annotation' => ['style' => 'prefix'], |
| 55 | + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], |
| 56 | + 'phpdoc_align' => ['align' => 'vertical'], |
| 57 | + 'phpdoc_line_span' => ['method' => 'multi', 'property' => 'multi'], |
| 58 | + 'phpdoc_no_package' => true, |
| 59 | + 'phpdoc_no_useless_inheritdoc' => true, |
| 60 | + 'phpdoc_scalar' => true, |
| 61 | + 'phpdoc_separation' => true, |
| 62 | + 'phpdoc_single_line_var_spacing' => true, |
| 63 | + 'phpdoc_trim' => true, |
| 64 | + 'phpdoc_trim_consecutive_blank_line_separation' => true, |
| 65 | + 'phpdoc_types' => true, |
| 66 | + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 67 | + 'phpdoc_var_without_name' => true, |
| 68 | + 'return_assignment' => true, |
| 69 | + 'short_scalar_cast' => true, |
| 70 | + 'single_trait_insert_per_statement' => true, |
| 71 | + 'standardize_not_equals' => true, |
| 72 | + 'static_lambda' => true, |
| 73 | + 'ternary_to_null_coalescing' => true, |
| 74 | + 'trim_array_spaces' => true, |
| 75 | + 'visibility_required' => true, |
| 76 | + 'yoda_style' => false, |
| 77 | + // 'native_function_invocation' => true, |
| 78 | + ]) |
| 79 | + ->setFinder( |
| 80 | + PhpCsFixer\Finder::create() |
| 81 | + ->in(__DIR__.'/src') |
| 82 | + ->in(__DIR__.'/tests') |
| 83 | + ->name('*.php') |
| 84 | + ) |
| 85 | +; |
| 86 | + |
| 87 | +return $config; |
0 commit comments