|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->exclude(__DIR__ . '/vendor') |
| 5 | + ->ignoreVCSIgnored(true) |
| 6 | + ->in(__DIR__ . '/src'); |
| 7 | + |
| 8 | +$config = new PhpCsFixer\Config(); |
| 9 | + |
| 10 | +return $config |
| 11 | + ->setRiskyAllowed(true) |
| 12 | + ->setIndent(str_pad('', 4)) |
| 13 | + ->setRules([ |
| 14 | + 'align_multiline_comment' => ['comment_type' => 'phpdocs_like'], |
| 15 | + 'array_indentation' => true, |
| 16 | + 'array_push' => true, |
| 17 | + 'array_syntax' => true, |
| 18 | + 'binary_operator_spaces' => ['default' => 'align_single_space_minimal'], |
| 19 | + 'blank_line_after_namespace' => true, |
| 20 | + 'blank_line_after_opening_tag' => true, |
| 21 | + 'blank_line_before_statement' => true, |
| 22 | + 'blank_line_between_import_groups' => true, |
| 23 | + 'braces' => ['allow_single_line_anonymous_class_with_empty_body' => true], |
| 24 | + 'cast_spaces' => true, |
| 25 | + 'class_attributes_separation' => true, |
| 26 | + 'class_definition' => true, |
| 27 | + 'class_reference_name_casing' => true, |
| 28 | + 'clean_namespace' => true, |
| 29 | + 'combine_consecutive_issets' => true, |
| 30 | + 'combine_consecutive_unsets' => true, |
| 31 | + 'comment_to_phpdoc' => true, |
| 32 | + 'concat_space' => ['spacing' => 'one'], |
| 33 | + 'constant_case' => true, |
| 34 | + 'control_structure_braces' => true, |
| 35 | + 'control_structure_continuation_position' => true, |
| 36 | + 'curly_braces_position' => true, |
| 37 | + 'dir_constant' => true, |
| 38 | + 'elseif' => true, |
| 39 | + 'empty_loop_body' => true, |
| 40 | + 'empty_loop_condition' => true, |
| 41 | + 'encoding' => true, |
| 42 | + 'ereg_to_preg' => true, |
| 43 | + 'explicit_indirect_variable' => true, |
| 44 | + 'explicit_string_variable' => true, |
| 45 | + 'function_declaration' => true, |
| 46 | + 'function_to_constant' => true, |
| 47 | + 'global_namespace_import' => ['import_constants' => false, 'import_functions' => false, 'import_classes' => true], |
| 48 | + 'group_import' => false, |
| 49 | + 'include' => true, |
| 50 | + 'indentation_type' => true, |
| 51 | + 'integer_literal_case' => true, |
| 52 | + 'line_ending' => true, |
| 53 | + 'linebreak_after_opening_tag' => true, |
| 54 | + 'lowercase_cast' => true, |
| 55 | + 'lowercase_keywords' => true, |
| 56 | + 'lowercase_static_reference' => true, |
| 57 | + 'magic_constant_casing' => true, |
| 58 | + 'magic_method_casing' => true, |
| 59 | + 'method_chaining_indentation' => true, |
| 60 | + 'multiline_comment_opening_closing' => true, |
| 61 | + 'multiline_whitespace_before_semicolons' => true, |
| 62 | + 'native_function_casing' => true, |
| 63 | + 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true], |
| 64 | + 'new_with_braces' => true, |
| 65 | + 'no_alias_language_construct_call' => true, |
| 66 | + 'no_alternative_syntax' => true, |
| 67 | + 'no_binary_string' => true, |
| 68 | + 'no_blank_lines_after_class_opening' => true, |
| 69 | + 'no_blank_lines_after_phpdoc' => true, |
| 70 | + 'no_break_comment' => true, |
| 71 | + 'no_closing_tag' => true, |
| 72 | + 'no_empty_phpdoc' => true, |
| 73 | + 'no_empty_statement' => true, |
| 74 | + 'no_extra_blank_lines' => true, |
| 75 | + 'no_leading_import_slash' => true, |
| 76 | + 'no_leading_namespace_whitespace' => true, |
| 77 | + 'no_multiple_statements_per_line' => true, |
| 78 | + 'no_null_property_initialization' => true, |
| 79 | + 'no_short_bool_cast' => true, |
| 80 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 81 | + 'no_space_around_double_colon' => true, |
| 82 | + 'no_spaces_after_function_name' => true, |
| 83 | + 'no_spaces_around_offset' => true, |
| 84 | + 'no_trailing_comma_in_singleline' => true, |
| 85 | + 'no_trailing_whitespace' => true, |
| 86 | + 'no_trailing_whitespace_in_comment' => true, |
| 87 | + 'no_unneeded_control_parentheses' => true, |
| 88 | + 'no_unneeded_curly_braces' => true, |
| 89 | + 'no_unneeded_import_alias' => true, |
| 90 | + 'no_unused_imports' => true, |
| 91 | + 'no_useless_else' => true, |
| 92 | + 'no_useless_return' => true, |
| 93 | + 'no_whitespace_in_blank_line' => true, |
| 94 | + 'no_spaces_inside_parenthesis' => true, |
| 95 | + 'object_operator_without_whitespace' => true, |
| 96 | + 'operator_linebreak' => true, |
| 97 | + 'ordered_class_elements' => true, |
| 98 | + 'ordered_imports' => true, |
| 99 | + 'php_unit_internal_class' => true, |
| 100 | + 'php_unit_method_casing' => true, |
| 101 | + 'php_unit_test_class_requires_covers' => true, |
| 102 | + 'phpdoc_add_missing_param_annotation' => true, |
| 103 | + 'phpdoc_align' => true, |
| 104 | + 'phpdoc_indent' => true, |
| 105 | + 'phpdoc_line_span' => true, |
| 106 | + 'phpdoc_no_package' => true, |
| 107 | + 'phpdoc_no_useless_inheritdoc' => true, |
| 108 | + 'phpdoc_order' => true, |
| 109 | + 'phpdoc_return_self_reference' => true, |
| 110 | + 'phpdoc_scalar' => true, |
| 111 | + 'phpdoc_separation' => true, |
| 112 | + 'phpdoc_tag_casing' => true, |
| 113 | + 'phpdoc_tag_type' => true, |
| 114 | + 'phpdoc_trim' => true, |
| 115 | + 'phpdoc_trim_consecutive_blank_line_separation' => true, |
| 116 | + 'phpdoc_types' => true, |
| 117 | + 'random_api_migration' => true, |
| 118 | + 'return_assignment' => true, |
| 119 | + 'simplified_if_return' => true, |
| 120 | + 'simplified_null_return' => true, |
| 121 | + 'single_blank_line_at_eof' => true, |
| 122 | + 'single_blank_line_before_namespace' => true, |
| 123 | + 'single_class_element_per_statement' => true, |
| 124 | + 'single_line_after_imports' => true, |
| 125 | + 'single_line_comment_spacing' => true, |
| 126 | + 'single_line_comment_style' => true, |
| 127 | + 'single_line_throw' => true, |
| 128 | + 'single_quote' => true, |
| 129 | + 'single_space_after_construct' => true, |
| 130 | + 'standardize_increment' => true, |
| 131 | + 'standardize_not_equals' => true, |
| 132 | + 'statement_indentation' => true, |
| 133 | + 'switch_continue_to_break' => true, |
| 134 | + 'ternary_operator_spaces' => true, |
| 135 | + ]) |
| 136 | + ->setFinder($finder); |
0 commit comments