|
1 | 1 | <?php
|
2 |
| -$finder = Symfony\CS\Finder\DefaultFinder::create() |
3 |
| -->in(__DIR__); |
4 | 2 |
|
5 |
| -$config = Symfony\CS\Config\Config::create() |
6 |
| -->level(Symfony\CS\FixerInterface::PSR2_LEVEL) |
7 |
| -->finder($finder) |
8 |
| -->fixers( |
9 |
| - [ |
10 |
| - 'extra_empty_lines', |
11 |
| - 'no_blank_lines_after_class_opening', |
12 |
| - 'no_empty_lines_after_phpdocs', |
13 |
| - 'operators_spaces', |
14 |
| - 'duplicate_semicolon', |
15 |
| - 'namespace_no_leading_whitespace', |
16 |
| - 'phpdoc_indent', |
17 |
| - 'phpdoc_no_empty_return', |
18 |
| - 'phpdoc_no_package', |
19 |
| - 'phpdoc_params', |
20 |
| - 'phpdoc_separation', |
21 |
| - 'phpdoc_to_comment', |
22 |
| - 'phpdoc_trim', |
23 |
| - 'phpdoc_var_without_name', |
24 |
| - 'remove_leading_slash_use', |
25 |
| - 'remove_lines_between_uses', |
26 |
| - 'return', |
27 |
| - 'single_array_no_trailing_comma', |
28 |
| - 'single_quote', |
29 |
| - 'spaces_before_semicolon', |
30 |
| - 'spaces_cast', |
31 |
| - 'standardize_not_equal', |
32 |
| - 'ternary_spaces', |
33 |
| - 'whitespacy_lines', |
34 |
| - 'ordered_use', |
35 |
| - 'short_array_syntax' |
36 |
| - ] |
37 |
| -); |
38 |
| -return $config; |
| 3 | +$header = <<<'EOF' |
| 4 | +This file is part of the Koriym.Baracoa package. |
| 5 | +
|
| 6 | +@license http://opensource.org/licenses/MIT MIT |
| 7 | +EOF; |
| 8 | + |
| 9 | +return \PhpCsFixer\Config::create() |
| 10 | + ->setRiskyAllowed(true) |
| 11 | + ->setRules(array( |
| 12 | + '@PSR2' => true, |
| 13 | + 'header_comment' => ['header' => $header, 'commentType' => 'PHPDoc', 'separate' => 'none'], |
| 14 | + 'array_syntax' => ['syntax' => 'short'], |
| 15 | + 'binary_operator_spaces' => ['align_equals' => false, 'align_double_arrow' => false], |
| 16 | + 'blank_line_after_opening_tag' => true, |
| 17 | + 'blank_line_after_namespace' => false, |
| 18 | + 'blank_line_before_return' => true, |
| 19 | + 'cast_spaces' => true, |
| 20 | +// 'class_keyword_remove' => true, |
| 21 | + 'combine_consecutive_unsets' => true, |
| 22 | + 'concat_space' => ['spacing' => 'one'], |
| 23 | + 'declare_equal_normalize' => true, |
| 24 | + 'declare_strict_types' => false, |
| 25 | + 'dir_constant' => true, |
| 26 | + 'ereg_to_preg' => true, |
| 27 | + 'function_typehint_space' => true, |
| 28 | + 'general_phpdoc_annotation_remove' => true, |
| 29 | + 'hash_to_slash_comment' => true, |
| 30 | + 'heredoc_to_nowdoc' => true, |
| 31 | + 'include' => true, |
| 32 | + 'indentation_type' => true, |
| 33 | + 'is_null' => ['use_yoda_style' => false], |
| 34 | + 'linebreak_after_opening_tag' => true, |
| 35 | + 'lowercase_cast' => true, |
| 36 | +// 'mb_str_functions' => true, |
| 37 | + 'method_separation' => true, |
| 38 | + 'modernize_types_casting' => true, |
| 39 | + 'native_function_casing' => true, |
| 40 | +// 'native_function_invocation' => true, |
| 41 | + 'new_with_braces' => false, // |
| 42 | + 'no_alias_functions' => true, |
| 43 | + 'no_blank_lines_after_class_opening' => true, |
| 44 | + 'no_blank_lines_after_phpdoc' => true, |
| 45 | + 'no_blank_lines_before_namespace' => true, |
| 46 | + 'no_empty_comment' => true, |
| 47 | + 'no_empty_phpdoc' => true, |
| 48 | + 'no_empty_statement' => true, |
| 49 | + 'no_extra_consecutive_blank_lines' => ['break', 'continue', 'curly_brace_block', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'throw', 'use', 'useTrait'], |
| 50 | + 'no_leading_import_slash' => true, |
| 51 | + 'no_leading_namespace_whitespace' => true, |
| 52 | + 'no_mixed_echo_print' => ['use' => 'echo'], |
| 53 | + 'no_multiline_whitespace_around_double_arrow' => true, |
| 54 | + 'no_multiline_whitespace_before_semicolons' => true, |
| 55 | + 'no_php4_constructor' => false, |
| 56 | + 'no_short_bool_cast' => true, |
| 57 | + 'no_short_echo_tag' => false, |
| 58 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 59 | + 'no_spaces_around_offset' => true, |
| 60 | + 'no_trailing_comma_in_list_call' => true, |
| 61 | + 'no_trailing_comma_in_singleline_array' => true, |
| 62 | + 'no_trailing_whitespace' => true, |
| 63 | + 'no_trailing_whitespace_in_comment' => true, |
| 64 | + 'no_unneeded_control_parentheses' => true, |
| 65 | + 'no_unreachable_default_argument_value' => true, |
| 66 | + 'no_unused_imports' => true, |
| 67 | + 'no_useless_else' => true, |
| 68 | + 'no_useless_return' => true, |
| 69 | + 'no_whitespace_before_comma_in_array' => true, |
| 70 | + 'no_whitespace_in_blank_line' => true, |
| 71 | + 'normalize_index_brace' => true, |
| 72 | + 'not_operator_with_space' => false, |
| 73 | + 'not_operator_with_successor_space' => true, |
| 74 | + 'object_operator_without_whitespace' => true, |
| 75 | + 'ordered_class_elements' => true, |
| 76 | + 'ordered_imports' => true, |
| 77 | + 'php_unit_construct' => true, |
| 78 | + 'php_unit_dedicate_assert' => true, |
| 79 | + 'php_unit_fqcn_annotation' => true, |
| 80 | + 'php_unit_strict' => true, |
| 81 | +// 'phpdoc_add_missing_param_annotation' => true, |
| 82 | + 'phpdoc_align' => true, |
| 83 | + 'phpdoc_annotation_without_dot' => true, |
| 84 | + 'phpdoc_indent' => true, |
| 85 | + 'phpdoc_inline_tag' => true, |
| 86 | + 'phpdoc_no_access' => true, |
| 87 | + 'phpdoc_no_alias_tag' => ['property-read' => 'property', 'property-write' => 'property', 'type' => 'var'], |
| 88 | + 'phpdoc_no_empty_return' => true, |
| 89 | + 'phpdoc_no_package' => true, |
| 90 | +// 'phpdoc_no_useless_inheritdoc' => true, |
| 91 | + 'phpdoc_order' => true, |
| 92 | + 'phpdoc_return_self_reference' => true, |
| 93 | + 'phpdoc_scalar' => true, |
| 94 | + 'phpdoc_separation' => true, |
| 95 | + 'phpdoc_single_line_var_spacing' => true, |
| 96 | +// 'phpdoc_summary' => true, |
| 97 | + 'phpdoc_to_comment' => true, |
| 98 | + 'phpdoc_trim' => true, |
| 99 | + 'phpdoc_types' => true, |
| 100 | + 'phpdoc_var_without_name' => true, |
| 101 | + 'pow_to_exponentiation' => true, |
| 102 | +// 'pre_increment' => true, |
| 103 | + 'protected_to_private' => true, |
| 104 | + 'psr0' => true, |
| 105 | + 'psr4' => true, |
| 106 | + 'random_api_migration' => true, |
| 107 | + 'return_type_declaration' => ['space_before' => 'one'], |
| 108 | + 'self_accessor' => true, |
| 109 | + 'short_scalar_cast' => true, |
| 110 | +// 'silenced_deprecation_error' => true, |
| 111 | +// 'simplified_null_return' => true, |
| 112 | +// 'single_blank_line_before_namespace' => true, |
| 113 | + 'single_quote' => true, |
| 114 | + 'space_after_semicolon' => true, |
| 115 | + 'standardize_not_equals' => true, |
| 116 | +// 'strict_comparison' => true, |
| 117 | + 'ternary_operator_spaces' => true, |
| 118 | + 'strict_param' => true, |
| 119 | + 'ternary_to_null_coalescing' => true, |
| 120 | +// 'trailing_comma_in_multiline_array' => true, |
| 121 | + 'trim_array_spaces' => true, |
| 122 | + 'unary_operator_spaces' => true, |
| 123 | + 'whitespace_after_comma_in_array' => true |
| 124 | + )) |
| 125 | + ->setFinder( |
| 126 | + PhpCsFixer\Finder::create() |
| 127 | + ->exclude('tests/Fake') |
| 128 | + ->exclude('src-data') |
| 129 | + ->in(__DIR__) |
| 130 | + )->setLineEnding("\n") |
| 131 | + ->setUsingCache(false); |
0 commit comments