|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->path([ |
| 5 | + 'src/', |
| 6 | + 'tests/', |
| 7 | + ]) |
| 8 | + ->notPath([ |
| 9 | + 'src/Parser.php', |
| 10 | + ]) |
| 11 | + ->ignoreVCSIgnored(true) |
| 12 | + ->append([__FILE__]) |
| 13 | + ->in(__DIR__); |
| 14 | + |
| 15 | +$config = new PhpCsFixer\Config(); |
| 16 | +return $config |
| 17 | + ->setRules([ |
| 18 | + '@PER-CS' => true, |
| 19 | + 'align_multiline_comment' => true, |
| 20 | + 'array_syntax' => true, |
| 21 | + 'binary_operator_spaces' => true, |
| 22 | + 'class_attributes_separation' => ['elements' => ['method' => 'one']], |
| 23 | + 'class_reference_name_casing' => true, |
| 24 | + 'clean_namespace' => true, |
| 25 | + 'combine_consecutive_unsets' => true, |
| 26 | + 'declare_parentheses' => true, |
| 27 | + 'integer_literal_case' => true, |
| 28 | + 'lambda_not_used_import' => true, |
| 29 | + 'linebreak_after_opening_tag' => true, |
| 30 | + 'method_chaining_indentation' => true, |
| 31 | + 'multiline_comment_opening_closing' => true, |
| 32 | + 'native_function_casing' => true, |
| 33 | + 'no_alternative_syntax' => true, |
| 34 | + 'no_blank_lines_after_phpdoc' => true, |
| 35 | + 'no_empty_comment' => true, |
| 36 | + 'no_empty_phpdoc' => true, |
| 37 | + 'no_empty_statement' => true, |
| 38 | + 'no_extra_blank_lines' => true, |
| 39 | + 'no_spaces_around_offset' => true, |
| 40 | + 'no_superfluous_phpdoc_tags' => true, |
| 41 | + 'no_unneeded_control_parentheses' => true, |
| 42 | + 'no_unused_imports' => true, |
| 43 | + 'no_useless_return' => true, |
| 44 | + 'no_whitespace_before_comma_in_array' => true, |
| 45 | + 'object_operator_without_whitespace' => true, |
| 46 | + 'ordered_imports' => ['sort_algorithm' => 'alpha'], |
| 47 | + 'phpdoc_indent' => true, |
| 48 | + 'phpdoc_no_empty_return' => true, |
| 49 | + 'phpdoc_single_line_var_spacing' => true, |
| 50 | + 'return_assignment' => true, |
| 51 | + 'semicolon_after_instruction' => true, |
| 52 | + 'single_class_element_per_statement' => true, |
| 53 | + 'single_space_around_construct' => true, |
| 54 | + 'space_after_semicolon' => true, |
| 55 | + 'standardize_not_equals' => true, |
| 56 | + 'trim_array_spaces' => true, |
| 57 | + 'type_declaration_spaces' => true, |
| 58 | + 'types_spaces' => true, |
| 59 | + 'whitespace_after_comma_in_array' => ['ensure_single_space' => true], |
| 60 | + ]) |
| 61 | + ->setFinder($finder); |
0 commit comments