10
10
* @copyright 2019 AppSeeds
11
11
* @see https://github.com/shinsenter/defer.php/blob/develop/README.md
12
12
*/
13
- use PhpCsFixer \Config ;
14
- use PhpCsFixer \Finder ;
15
13
16
14
$ header = <<<'EOF'
17
15
A PHP helper class to efficiently defer JavaScript for your website.
@@ -25,82 +23,75 @@ A PHP helper class to efficiently defer JavaScript for your website.
25
23
EOF;
26
24
27
25
$ rules = [
28
- '@PHP56Migration ' => true ,
29
- '@PHP70Migration ' => true ,
30
- '@PHP71Migration ' => true ,
31
- '@Symfony ' => true ,
32
- '@PSR2 ' => true ,
33
- 'align_multiline_comment ' => true ,
34
- 'array_indentation ' => true ,
35
- 'array_syntax ' => ['syntax ' => 'short ' ],
36
- 'combine_consecutive_issets ' => true ,
37
- 'combine_consecutive_unsets ' => true ,
38
- 'compact_nullable_typehint ' => true ,
39
- 'concat_space ' => ['spacing ' => 'one ' ],
40
- 'escape_implicit_backslashes ' => true ,
41
- 'explicit_indirect_variable ' => true ,
42
- 'explicit_string_variable ' => true ,
43
- 'fully_qualified_strict_types ' => true ,
44
- 'header_comment ' => ['header ' => $ header , 'comment_type ' => 'PHPDoc ' , 'location ' => 'after_open ' , 'separate ' => 'both ' ],
45
- 'heredoc_to_nowdoc ' => true ,
46
- 'increment_style ' => ['style ' => 'post ' ],
47
- 'list_syntax ' => ['syntax ' => 'long ' ],
48
- 'method_argument_space ' => ['on_multiline ' => 'ensure_fully_multiline ' ],
49
- 'method_chaining_indentation ' => true ,
50
- 'multiline_comment_opening_closing ' => true ,
51
- 'native_function_invocation ' => false ,
52
- 'no_alternative_syntax ' => true ,
53
- 'no_blank_lines_before_namespace ' => false ,
54
- 'no_binary_string ' => true ,
55
- 'no_empty_phpdoc ' => true ,
56
- 'no_null_property_initialization ' => true ,
57
- 'no_short_echo_tag ' => true ,
58
- 'no_superfluous_elseif ' => true ,
59
- 'no_unneeded_curly_braces ' => true ,
60
- 'no_unneeded_final_method ' => true ,
61
- 'no_useless_else ' => true ,
62
- 'no_useless_return ' => true ,
63
- 'ordered_class_elements ' => true ,
64
- 'ordered_imports ' => true ,
65
- 'php_unit_internal_class ' => true ,
66
- 'php_unit_ordered_covers ' => true ,
67
- 'php_unit_test_class_requires_covers ' => true ,
68
- 'phpdoc_add_missing_param_annotation ' => true ,
69
- 'phpdoc_order ' => true ,
70
- 'phpdoc_separation ' => false ,
71
- 'phpdoc_summary ' => false ,
72
- 'phpdoc_trim_consecutive_blank_line_separation ' => true ,
73
- 'phpdoc_types_order ' => true ,
74
- 'return_assignment ' => false ,
75
- 'semicolon_after_instruction ' => true ,
76
- 'single_line_comment_style ' => false ,
77
- 'single_quote ' => true ,
78
- 'yoda_style ' => false ,
79
- 'blank_line_before_statement ' => [
26
+ '@Symfony ' => true ,
27
+ '@PSR2 ' => true ,
28
+ 'align_multiline_comment ' => true ,
29
+ 'array_indentation ' => true ,
30
+ 'array_syntax ' => ['syntax ' => 'short ' ],
31
+ 'braces ' => ['allow_single_line_closure ' => true ],
32
+ 'combine_consecutive_issets ' => true ,
33
+ 'combine_consecutive_unsets ' => true ,
34
+ 'compact_nullable_typehint ' => true ,
35
+ 'concat_space ' => ['spacing ' => 'one ' ],
36
+ 'escape_implicit_backslashes ' => true ,
37
+ 'explicit_indirect_variable ' => true ,
38
+ 'explicit_string_variable ' => true ,
39
+ 'fully_qualified_strict_types ' => true ,
40
+ 'header_comment ' => ['header ' => $ header , 'comment_type ' => 'PHPDoc ' ],
41
+ 'heredoc_to_nowdoc ' => true ,
42
+ 'increment_style ' => ['style ' => 'post ' ],
43
+ 'list_syntax ' => ['syntax ' => 'long ' ],
44
+ 'method_argument_space ' => ['on_multiline ' => 'ensure_fully_multiline ' ],
45
+ 'method_chaining_indentation ' => true ,
46
+ 'multiline_comment_opening_closing ' => true ,
47
+ 'native_function_invocation ' => false ,
48
+ 'no_alternative_syntax ' => true ,
49
+ 'no_blank_lines_before_namespace ' => false ,
50
+ 'no_binary_string ' => true ,
51
+ 'no_empty_phpdoc ' => true ,
52
+ 'no_null_property_initialization ' => true ,
53
+ 'no_short_echo_tag ' => true ,
54
+ 'no_superfluous_elseif ' => true ,
55
+ 'no_unneeded_curly_braces ' => true ,
56
+ 'no_useless_else ' => true ,
57
+ 'no_useless_return ' => true ,
58
+ 'ordered_class_elements ' => true ,
59
+ 'ordered_imports ' => true ,
60
+ 'php_unit_internal_class ' => true ,
61
+ 'php_unit_ordered_covers ' => true ,
62
+ 'php_unit_test_class_requires_covers ' => true ,
63
+ 'phpdoc_add_missing_param_annotation ' => true ,
64
+ 'phpdoc_order ' => true ,
65
+ 'phpdoc_separation ' => false ,
66
+ 'phpdoc_summary ' => false ,
67
+ 'phpdoc_types_order ' => true ,
68
+ 'return_assignment ' => false ,
69
+ 'semicolon_after_instruction ' => true ,
70
+ 'single_line_comment_style ' => false ,
71
+ 'single_quote ' => true ,
72
+ 'yoda_style ' => false ,
73
+ 'blank_line_before_statement ' => [
80
74
'statements ' => [
81
75
'continue ' , 'declare ' , 'return ' , 'throw ' , 'try ' ,
82
76
'declare ' , 'for ' , 'foreach ' , 'goto ' , 'if ' ,
83
77
],
84
78
],
85
- 'no_extra_blank_lines ' => [
79
+ 'no_extra_blank_lines ' => [
86
80
'tokens ' => [
87
81
'continue ' , 'extra ' , 'return ' , 'throw ' , 'use ' ,
88
82
'parenthesis_brace_block ' , 'square_brace_block ' , 'curly_brace_block ' ,
89
83
],
90
84
],
91
- 'braces ' => [
92
- 'allow_single_line_closure ' => true ,
93
- ],
94
- 'binary_operator_spaces ' => [
85
+ 'binary_operator_spaces ' => [
95
86
'default ' => 'single_space ' ,
96
87
'operators ' => [
97
- '=> ' => 'align_single_space ' ,
98
- '= ' => 'align_single_space ' ,
88
+ '= ' => 'align_single_space_minimal ' ,
89
+ '=> ' => 'align_single_space_minimal ' ,
99
90
],
100
91
],
101
92
];
102
93
103
- $ finder = Finder::create ()
94
+ $ finder = \ PhpCsFixer \ Finder::create ()
104
95
->in (__DIR__ )
105
96
->name ('*.php ' )
106
97
->exclude ('.idea ' )
@@ -110,7 +101,8 @@ $finder = Finder::create()
110
101
->ignoreDotFiles (true )
111
102
->ignoreVCS (true );
112
103
113
- return Config::create ()
104
+ return \ PhpCsFixer \ Config::create ()
114
105
->setFinder ($ finder )
115
106
->setRules ($ rules )
116
- ->setUsingCache (true );
107
+ ->setLineEnding ("\n" )
108
+ ->setUsingCache (false );
0 commit comments