11
11
* @package defer-wordpress
12
12
* @author Mai Nhut Tan <[email protected] >
13
13
* @copyright 2021 AppSeeds
14
- * @license https://code.shin.company/defer-wordpress/blob/master/LICENSE GNU
14
+ * @license https://code.shin.company/defer-wordpress/blob/master/LICENSE GPL-2.0
15
15
* @link https://code.shin.company/defer-wordpress
16
16
* @see https://code.shin.company/defer-wordpress/blob/master/README.md
17
17
*/
@@ -33,85 +33,86 @@ PHP Version >=5.6
33
33
EOF;
34
34
35
35
$ rules = [
36
- '@Symfony ' => true ,
37
- '@PSR2 ' => true ,
38
- 'align_multiline_comment ' => true ,
39
- 'array_indentation ' => true ,
40
- 'array_syntax ' => ['syntax ' => 'short ' ],
41
- 'braces ' => ['allow_single_line_closure ' => true ],
42
- 'combine_consecutive_issets ' => true ,
43
- 'combine_consecutive_unsets ' => true ,
44
- 'compact_nullable_typehint ' => true ,
45
- 'concat_space ' => ['spacing ' => 'one ' ],
46
- 'escape_implicit_backslashes ' => true ,
47
- 'explicit_indirect_variable ' => true ,
48
- 'explicit_string_variable ' => true ,
49
- 'fully_qualified_strict_types ' => true ,
50
- 'header_comment ' => ['header ' => $ header , 'comment_type ' => 'PHPDoc ' ],
51
- 'heredoc_to_nowdoc ' => true ,
52
- 'increment_style ' => ['style ' => 'post ' ],
53
- 'list_syntax ' => ['syntax ' => 'long ' ],
54
- 'method_argument_space ' => ['on_multiline ' => 'ensure_fully_multiline ' ],
55
- 'method_chaining_indentation ' => true ,
56
- 'multiline_comment_opening_closing ' => true ,
57
- 'native_function_invocation ' => false ,
58
- 'no_alternative_syntax ' => true ,
59
- 'no_blank_lines_before_namespace ' => false ,
60
- 'no_binary_string ' => true ,
61
- 'no_empty_phpdoc ' => true ,
62
- 'no_null_property_initialization ' => true ,
63
- 'no_short_echo_tag ' => true ,
64
- 'no_superfluous_elseif ' => true ,
65
- 'no_unneeded_curly_braces ' => true ,
66
- 'no_useless_else ' => true ,
67
- 'no_useless_return ' => true ,
68
- 'ordered_class_elements ' => true ,
69
- 'ordered_imports ' => true ,
70
- 'php_unit_internal_class ' => true ,
71
- 'php_unit_ordered_covers ' => true ,
72
- 'php_unit_test_class_requires_covers ' => true ,
73
- 'phpdoc_add_missing_param_annotation ' => true ,
74
- 'phpdoc_order ' => true ,
75
- 'phpdoc_separation ' => false ,
76
- 'phpdoc_summary ' => false ,
77
- 'phpdoc_types_order ' => true ,
78
- 'return_assignment ' => false ,
79
- 'semicolon_after_instruction ' => true ,
80
- 'single_line_comment_style ' => false ,
81
- 'single_quote ' => true ,
82
- 'yoda_style ' => false ,
83
- 'blank_line_before_statement ' => [
84
- 'statements ' => [
85
- 'continue ' , 'declare ' , 'return ' , 'throw ' , 'try ' ,
86
- 'declare ' , 'for ' , 'foreach ' , 'goto ' , 'if ' ,
87
- ],
36
+ '@Symfony ' => true ,
37
+ '@PSR2 ' => true ,
38
+ 'align_multiline_comment ' => true ,
39
+ 'array_indentation ' => true ,
40
+ 'array_syntax ' => ['syntax ' => 'short ' ],
41
+ 'braces ' => ['allow_single_line_closure ' => true ],
42
+ 'combine_consecutive_issets ' => true ,
43
+ 'combine_consecutive_unsets ' => true ,
44
+ 'compact_nullable_typehint ' => true ,
45
+ 'concat_space ' => ['spacing ' => 'one ' ],
46
+ 'escape_implicit_backslashes ' => true ,
47
+ 'explicit_indirect_variable ' => true ,
48
+ 'explicit_string_variable ' => true ,
49
+ 'fully_qualified_strict_types ' => true ,
50
+ 'header_comment ' => ['header ' => $ header , 'comment_type ' => 'PHPDoc ' ],
51
+ 'heredoc_to_nowdoc ' => true ,
52
+ 'increment_style ' => ['style ' => 'post ' ],
53
+ 'list_syntax ' => ['syntax ' => 'long ' ],
54
+ 'method_argument_space ' => ['on_multiline ' => 'ensure_fully_multiline ' ],
55
+ 'method_chaining_indentation ' => true ,
56
+ 'multiline_comment_opening_closing ' => true ,
57
+ 'native_function_invocation ' => false ,
58
+ 'no_alternative_syntax ' => true ,
59
+ 'no_blank_lines_before_namespace ' => false ,
60
+ 'no_binary_string ' => true ,
61
+ 'no_empty_phpdoc ' => true ,
62
+ 'no_null_property_initialization ' => true ,
63
+ 'no_short_echo_tag ' => true ,
64
+ 'no_superfluous_elseif ' => true ,
65
+ 'no_unneeded_curly_braces ' => true ,
66
+ 'no_useless_else ' => true ,
67
+ 'no_useless_return ' => true ,
68
+ 'ordered_class_elements ' => true ,
69
+ 'ordered_imports ' => true ,
70
+ 'php_unit_internal_class ' => true ,
71
+ 'php_unit_ordered_covers ' => true ,
72
+ 'php_unit_test_class_requires_covers ' => true ,
73
+ 'phpdoc_add_missing_param_annotation ' => true ,
74
+ 'phpdoc_order ' => true ,
75
+ 'phpdoc_separation ' => false ,
76
+ 'phpdoc_summary ' => false ,
77
+ 'phpdoc_types_order ' => true ,
78
+ 'return_assignment ' => false ,
79
+ 'semicolon_after_instruction ' => true ,
80
+ 'single_line_comment_style ' => false ,
81
+ 'single_quote ' => true ,
82
+ 'yoda_style ' => false ,
83
+ 'blank_line_before_statement ' => [
84
+ 'statements ' => [
85
+ 'continue ' , 'declare ' , 'return ' , 'throw ' , 'try ' ,
86
+ 'declare ' , 'for ' , 'foreach ' , 'goto ' , 'if ' ,
88
87
],
89
- ' no_extra_blank_lines ' => [
90
- ' tokens ' => [
91
- ' continue ' , ' extra ' , ' return ' , ' throw ' , ' use ' ,
92
- ' parenthesis_brace_block ' , 'square_brace_block ' , 'curly_brace_block ' ,
93
- ] ,
88
+ ],
89
+ ' no_extra_blank_lines ' => [
90
+ ' tokens ' => [
91
+ ' continue ' , ' extra ' , ' return ' , 'throw ' , 'use ' ,
92
+ ' parenthesis_brace_block ' , ' square_brace_block ' , ' curly_brace_block ' ,
94
93
],
95
- ' binary_operator_spaces ' => [
96
- ' default ' => ' single_space ' ,
97
- ' operators ' => [
98
- ' = ' => ' align_single_space_minimal ' ,
99
- ' => ' => 'align_single_space_minimal ' ,
100
- ] ,
94
+ ],
95
+ ' binary_operator_spaces ' => [
96
+ ' default ' => ' single_space ' ,
97
+ ' operators ' => [
98
+ ' = ' => 'align_single_space_minimal ' ,
99
+ ' => ' => ' align_single_space_minimal ' ,
101
100
],
101
+ ],
102
102
];
103
103
104
104
$ finder = \PhpCsFixer \Finder::create ()
105
- ->in (__DIR__ . DIRECTORY_SEPARATOR )
106
- ->name ('*.php ' )
107
- ->exclude ('.dist ' )
108
- ->exclude ('.docker ' )
109
- ->exclude ('cache ' )
110
- ->ignoreDotFiles (true )
111
- ->ignoreVCS (true );
105
+ ->in (__DIR__ . DIRECTORY_SEPARATOR )
106
+ ->name ('*.php ' )
107
+ ->exclude ('.dist ' )
108
+ ->exclude ('.docker ' )
109
+ ->exclude ('cache ' )
110
+ ->ignoreDotFiles (true )
111
+ ->ignoreVCS (true );
112
112
113
113
return \PhpCsFixer \Config::create ()
114
- ->setFinder ($ finder )
115
- ->setRules ($ rules )
116
- ->setLineEnding ("\n" )
117
- ->setUsingCache (false );
114
+ ->setFinder ($ finder )
115
+ ->setRules ($ rules )
116
+ ->setIndent (' ' )
117
+ ->setLineEnding ("\n" )
118
+ ->setUsingCache (false );
0 commit comments