Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit f5fc921

Browse files
authored
Merge pull request #50 from shinsenter/develop
Bug fixes and improvements
2 parents b59a8c1 + 396bde1 commit f5fc921

18 files changed

+863
-850
lines changed

.php_cs

Lines changed: 76 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @package defer-wordpress
1212
* @author Mai Nhut Tan <[email protected]>
1313
* @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
1515
* @link https://code.shin.company/defer-wordpress
1616
* @see https://code.shin.company/defer-wordpress/blob/master/README.md
1717
*/
@@ -33,85 +33,86 @@ PHP Version >=5.6
3333
EOF;
3434

3535
$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',
8887
],
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',
9493
],
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',
101100
],
101+
],
102102
];
103103

104104
$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);
112112

113113
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);

README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ We recommend you use it with another page-caching plugin for best performance.
164164

165165
== Changelog ==
166166

167+
2.3 Bug fixes and improvements
168+
167169
2.2 Code improvements
168170

169171
2.1 Bug fixes (https://github.com/shinsenter/defer.js/issues/82)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.0
1+
2.3.0

0 commit comments

Comments
 (0)