|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->in(__DIR__.'\src') |
| 5 | + ->in(__DIR__.'\tests') |
| 6 | +; |
| 7 | + |
| 8 | +return PhpCsFixer\Config::create() |
| 9 | + ->setIndent("\t") |
| 10 | + ->setLineEnding("\r\n") |
| 11 | + ->setRules([ |
| 12 | + 'array_syntax' => ['syntax' => 'short'], |
| 13 | + 'blank_line_after_namespace' => true, |
| 14 | + 'blank_line_after_opening_tag' => true, |
| 15 | + 'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'die', 'do', 'exit', 'for', 'foreach', 'goto', 'if', 'return', 'switch', 'throw', 'try', 'while', 'yield']], |
| 16 | + 'combine_consecutive_issets' => true, |
| 17 | + 'combine_consecutive_unsets' => true, |
| 18 | + 'concat_space' => ['spacing' => 'one'], |
| 19 | + 'declare_equal_normalize' => ['space' => 'single'], |
| 20 | + 'dir_constant' => true, |
| 21 | + 'elseif' => true, |
| 22 | + 'ereg_to_preg' => true, |
| 23 | + 'explicit_indirect_variable' => true, |
| 24 | + 'explicit_string_variable' => true, |
| 25 | + 'full_opening_tag' => true, |
| 26 | + 'function_typehint_space' => true, |
| 27 | + 'is_null' => true, |
| 28 | + 'linebreak_after_opening_tag' => true, |
| 29 | + 'list_syntax' => ['syntax' => 'short'], |
| 30 | + 'logical_operators' => true, |
| 31 | + 'lowercase_cast' => true, |
| 32 | + 'lowercase_constants' => true, |
| 33 | + 'lowercase_keywords' => true, |
| 34 | + 'lowercase_static_reference' => true, |
| 35 | + 'magic_constant_casing' => true, |
| 36 | + 'magic_method_casing' => true, |
| 37 | + 'method_chaining_indentation' => true, |
| 38 | + 'modernize_types_casting' => true, |
| 39 | + 'native_function_casing' => true, |
| 40 | + 'native_function_invocation' => [], |
| 41 | + 'new_with_braces' => true, |
| 42 | + 'no_alias_functions' => ['sets' => ['@all']], |
| 43 | + 'no_alternative_syntax' => true, |
| 44 | + 'no_blank_lines_after_phpdoc' => true, |
| 45 | + 'no_break_comment' => ['comment_text' => 'Intentionally fall through'], |
| 46 | + 'no_closing_tag' => true, |
| 47 | + 'no_empty_comment' => true, |
| 48 | + 'no_empty_statement' => true, |
| 49 | + 'no_leading_namespace_whitespace' => true, |
| 50 | + 'no_spaces_inside_parenthesis' => true, |
| 51 | + 'no_superfluous_phpdoc_tags' => true, |
| 52 | + 'no_trailing_whitespace' => true, |
| 53 | + 'no_trailing_whitespace_in_comment' => true, |
| 54 | + 'no_unneeded_control_parentheses' => true, |
| 55 | + 'no_unneeded_final_method' => true, |
| 56 | + 'no_unreachable_default_argument_value' => true, |
| 57 | + 'no_unset_cast' => true, |
| 58 | + 'no_useless_return' => true, |
| 59 | + 'no_whitespace_before_comma_in_array' => true, |
| 60 | + 'no_whitespace_in_blank_line' => true, |
| 61 | + 'non_printable_character' => ['use_escape_sequences_in_strings' => true], |
| 62 | + 'normalize_index_brace' => true, |
| 63 | + 'not_operator_with_successor_space' => true, |
| 64 | + 'ordered_class_elements' => ['sortAlgorithm' => 'alpha',], |
| 65 | + 'protected_to_private' => true, |
| 66 | + 'psr0' => true, |
| 67 | + 'return_type_declaration' => ['space_before' => 'one',], |
| 68 | + 'semicolon_after_instruction' => true, |
| 69 | + 'set_type_to_cast' => true, |
| 70 | + 'short_scalar_cast' => true, |
| 71 | + 'simple_to_complex_string_variable' => true, |
| 72 | + 'simplified_null_return' => true, |
| 73 | + 'single_blank_line_at_eof' => true, |
| 74 | + 'single_blank_line_before_namespace' => true, |
| 75 | + 'single_import_per_statement' => true, |
| 76 | + 'single_line_after_imports' => true, |
| 77 | + 'single_line_comment_style' => true, |
| 78 | + 'single_quote' => true, |
| 79 | + 'single_trait_insert_per_statement' => true, |
| 80 | + 'standardize_not_equals' => true, |
| 81 | + 'switch_case_semicolon_to_colon' => true, |
| 82 | + 'switch_case_space' => true, |
| 83 | + 'ternary_to_null_coalescing' => true, |
| 84 | + 'void_return' => true, |
| 85 | + 'yoda_style' => true, |
| 86 | +// 'braces' => ['position_after_control_structures' => 'next', 'position_after_functions_and_oop_constructs' => 'next', 'position_after_anonymous_constructs' => 'next',], |
| 87 | +// 'no_unneeded_curly_braces' => true, |
| 88 | + ]) |
| 89 | + ->setFinder($finder) |
| 90 | +; |
| 91 | + |
0 commit comments