1*04fd306cSNickeau<?php 2*04fd306cSNickeau 3*04fd306cSNickeau$finder = PhpCsFixer\Finder::create() 4*04fd306cSNickeau ->in([__DIR__ . '/lib', __DIR__ . '/tests']); 5*04fd306cSNickeau 6*04fd306cSNickeaureturn (new PhpCsFixer\Config()) 7*04fd306cSNickeau ->setRules([ 8*04fd306cSNickeau '@PSR2' => true, 9*04fd306cSNickeau 'array_syntax' => ['syntax' => 'short'], 10*04fd306cSNickeau 'binary_operator_spaces' => true, 11*04fd306cSNickeau 'blank_line_before_statement' => ['statements' => ['return', 'try']], 12*04fd306cSNickeau 'braces' => ['allow_single_line_anonymous_class_with_empty_body' => true, 'allow_single_line_closure' => true], 13*04fd306cSNickeau 'cast_spaces' => true, 14*04fd306cSNickeau 'class_attributes_separation' => ['elements' => ['method' => 'one']], 15*04fd306cSNickeau 'clean_namespace' => true, 16*04fd306cSNickeau 'compact_nullable_typehint' => true, 17*04fd306cSNickeau 'concat_space' => ['spacing' => 'one'], 18*04fd306cSNickeau 'declare_equal_normalize' => true, 19*04fd306cSNickeau 'fopen_flag_order' => true, 20*04fd306cSNickeau 'fopen_flags' => true, 21*04fd306cSNickeau 'full_opening_tag' => true, 22*04fd306cSNickeau 'function_typehint_space' => true, 23*04fd306cSNickeau 'implode_call' => true, 24*04fd306cSNickeau 'is_null' => true, 25*04fd306cSNickeau 'lambda_not_used_import' => true, 26*04fd306cSNickeau 'linebreak_after_opening_tag' => true, 27*04fd306cSNickeau 'lowercase_cast' => true, 28*04fd306cSNickeau 'lowercase_static_reference' => true, 29*04fd306cSNickeau 'magic_constant_casing' => true, 30*04fd306cSNickeau 'magic_method_casing' => true, 31*04fd306cSNickeau 'mb_str_functions' => true, 32*04fd306cSNickeau 'native_function_casing' => true, 33*04fd306cSNickeau 'native_function_type_declaration_casing' => true, 34*04fd306cSNickeau 'new_with_braces' => true, 35*04fd306cSNickeau 'no_alias_functions' => true, 36*04fd306cSNickeau 'no_blank_lines_after_class_opening' => true, 37*04fd306cSNickeau 'no_blank_lines_after_phpdoc' => true, 38*04fd306cSNickeau 'no_empty_comment' => true, 39*04fd306cSNickeau 'no_empty_phpdoc' => true, 40*04fd306cSNickeau 'no_empty_statement' => true, 41*04fd306cSNickeau 'normalize_index_brace' => true, 42*04fd306cSNickeau 'no_extra_blank_lines' => [ 43*04fd306cSNickeau 'tokens' => [ 44*04fd306cSNickeau 'break', 45*04fd306cSNickeau 'case', 46*04fd306cSNickeau 'continue', 47*04fd306cSNickeau 'curly_brace_block', 48*04fd306cSNickeau 'default', 49*04fd306cSNickeau 'extra', 50*04fd306cSNickeau 'parenthesis_brace_block', 51*04fd306cSNickeau 'return', 52*04fd306cSNickeau 'square_brace_block', 53*04fd306cSNickeau 'switch', 54*04fd306cSNickeau 'throw', 55*04fd306cSNickeau 'use', 56*04fd306cSNickeau 'use_trait', 57*04fd306cSNickeau ], 58*04fd306cSNickeau ], 59*04fd306cSNickeau 'no_leading_import_slash' => true, 60*04fd306cSNickeau 'no_leading_namespace_whitespace' => true, 61*04fd306cSNickeau 'no_singleline_whitespace_before_semicolons' => true, 62*04fd306cSNickeau 'no_trailing_comma_in_singleline_array' => true, 63*04fd306cSNickeau 'no_unreachable_default_argument_value' => true, 64*04fd306cSNickeau 'no_unused_imports' => true, 65*04fd306cSNickeau 'no_useless_else' => true, 66*04fd306cSNickeau 'no_useless_return' => true, 67*04fd306cSNickeau 'no_useless_sprintf' => true, 68*04fd306cSNickeau 'no_whitespace_in_blank_line' => true, 69*04fd306cSNickeau 'object_operator_without_whitespace' => true, 70*04fd306cSNickeau 'ordered_class_elements' => true, 71*04fd306cSNickeau 'ordered_imports' => true, 72*04fd306cSNickeau 'php_unit_construct' => true, 73*04fd306cSNickeau 'php_unit_dedicate_assert' => false, 74*04fd306cSNickeau 'php_unit_expectation' => ['target' => '5.6'], 75*04fd306cSNickeau 'php_unit_method_casing' => ['case' => 'camel_case'], 76*04fd306cSNickeau 'php_unit_mock_short_will_return' => true, 77*04fd306cSNickeau 'php_unit_mock' => true, 78*04fd306cSNickeau 'php_unit_namespaced' => ['target' => '5.7'], 79*04fd306cSNickeau 'php_unit_no_expectation_annotation' => true, 80*04fd306cSNickeau 'php_unit_set_up_tear_down_visibility' => true, 81*04fd306cSNickeau 'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], 82*04fd306cSNickeau 'phpdoc_add_missing_param_annotation' => true, 83*04fd306cSNickeau 'phpdoc_indent' => true, 84*04fd306cSNickeau 'phpdoc_no_access' => true, 85*04fd306cSNickeau // 'phpdoc_no_empty_return' => true, // disabled to allow forward compatibility with PHP 8.1 86*04fd306cSNickeau 'phpdoc_no_package' => true, 87*04fd306cSNickeau 'phpdoc_order_by_value' => ['annotations' => ['covers', 'group', 'throws']], 88*04fd306cSNickeau 'phpdoc_order' => true, 89*04fd306cSNickeau 'phpdoc_return_self_reference' => true, 90*04fd306cSNickeau 'phpdoc_scalar' => true, 91*04fd306cSNickeau 'phpdoc_single_line_var_spacing' => true, 92*04fd306cSNickeau 'phpdoc_trim' => true, 93*04fd306cSNickeau 'phpdoc_types' => true, 94*04fd306cSNickeau 'phpdoc_var_annotation_correct_order' => true, 95*04fd306cSNickeau 'psr_autoloading' => true, 96*04fd306cSNickeau 'self_accessor' => true, 97*04fd306cSNickeau 'set_type_to_cast' => true, 98*04fd306cSNickeau 'short_scalar_cast' => true, 99*04fd306cSNickeau 'single_blank_line_before_namespace' => true, 100*04fd306cSNickeau 'single_quote' => true, 101*04fd306cSNickeau 'single_space_after_construct' => true, 102*04fd306cSNickeau 'single_trait_insert_per_statement' => true, 103*04fd306cSNickeau 'space_after_semicolon' => true, 104*04fd306cSNickeau 'standardize_not_equals' => true, 105*04fd306cSNickeau 'strict_param' => true, 106*04fd306cSNickeau 'switch_continue_to_break' => true, 107*04fd306cSNickeau 'ternary_operator_spaces' => true, 108*04fd306cSNickeau 'ternary_to_elvis_operator' => true, 109*04fd306cSNickeau 'trailing_comma_in_multiline' => ['elements' => ['arrays']], 110*04fd306cSNickeau 'trim_array_spaces' => true, 111*04fd306cSNickeau 'unary_operator_spaces' => true, 112*04fd306cSNickeau 'visibility_required' => ['elements' => ['method', 'property']], 113*04fd306cSNickeau 'whitespace_after_comma_in_array' => true, 114*04fd306cSNickeau 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], 115*04fd306cSNickeau ]) 116*04fd306cSNickeau ->setRiskyAllowed(true) 117*04fd306cSNickeau ->setFinder($finder); 118