Skip to content

Commit afccf1e

Browse files
committed
Merge pull request #581 from TGMPA/develop
Release v 2.6.0
2 parents ba41c10 + 6963a59 commit afccf1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+9281
-421
lines changed

.scrutinizer.yml

Lines changed: 202 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,46 @@
1+
tools:
2+
php_sim: true
3+
php_pdepend: true
4+
php_analyzer: true
5+
sensiolabs_security_checker: true
6+
17
checks:
28
php:
9+
useless_calls: true
10+
unused_variables: true
11+
unused_properties: true
12+
unused_parameters: true
13+
unused_methods: true
14+
unreachable_code: true
15+
too_many_arguments: true
16+
no_unnecessary_if: true
17+
no_unnecessary_final_modifier: true
18+
no_empty_statements: true
19+
fix_use_statements:
20+
remove_unused: true
21+
preserve_multiple: false
22+
preserve_blanklines: false
23+
order_alphabetically: true
24+
avoid_useless_overridden_methods: true
325
use_self_instead_of_fqcn: true
426
uppercase_constants: true
27+
single_namespace_per_use: false
528
simplify_boolean_return: true
6-
return_doc_comment_if_not_inferrable: true
29+
require_scope_for_properties: true
30+
require_scope_for_methods: true
731
remove_extra_empty_lines: true
32+
psr2_switch_declaration: true
33+
psr2_class_declaration: true
34+
properties_in_camelcaps: false
835
prefer_while_loop_over_for_loop: true
9-
parameter_doc_comments: true
10-
param_doc_comment_if_not_inferrable: true
36+
parameters_in_camelcaps: false
1137
optional_parameters_at_the_end: true
12-
no_short_method_names:
13-
minimum: '3'
14-
no_long_variable_names:
15-
maximum: '25'
16-
no_goto: true
38+
no_underscore_prefix_in_properties: true
39+
no_underscore_prefix_in_methods: true
40+
no_trailing_whitespace: true
41+
no_new_line_at_end_of_file: false
42+
no_error_suppression: false
43+
no_commented_out_code: true
1744
newline_at_end_of_file: true
1845
naming_conventions:
1946
local_variable: '^[a-z][a-z_0-9]*$'
@@ -27,24 +54,181 @@ checks:
2754
type_name: '^[A-Z][a-zA-Z0-9_]*$'
2855
exception_name: '^[A-Z][a-zA-Z0-9_]*Exception$'
2956
isser_method_name: '^(?:is|has|should|may|supports)'
30-
more_specific_types_in_doc_comments: true
57+
function_in_camel_caps: false
3158
fix_line_ending: true
32-
fix_use_statements:
33-
remove_unused: true
34-
preserve_multiple: false
35-
preserve_blanklines: false
36-
order_alphabetically: true
3759
encourage_single_quotes: true
3860
encourage_postdec_operator: true
61+
classes_in_camel_caps: false
62+
blank_line_after_namespace_declaration: true
3963
avoid_todo_comments: true
4064
avoid_perl_style_comments: true
4165
avoid_multiple_statements_on_same_line: true
66+
avoid_length_functions_in_loops: true
4267
avoid_fixme_comments: true
68+
avoid_closing_tag: true
69+
avoid_aliased_php_functions: true
4370
align_assignments: true
44-
no_global_keyword: false
45-
one_class_per_file: false
71+
duplication: true
72+
sql_injection_vulnerabilities: true
73+
security_vulnerabilities: true
74+
no_eval: true
75+
switch_fallthrough_commented: true
76+
phpunit_assertions: false
77+
overriding_private_members: true
78+
non_commented_empty_catch_block: true
79+
no_short_variable_names:
80+
minimum: '3'
81+
no_short_method_names:
82+
minimum: '3'
83+
no_long_variable_names:
84+
maximum: '30'
85+
no_goto: true
86+
avoid_usage_of_logical_operators: true
87+
return_doc_comments: true
88+
return_doc_comment_if_not_inferrable: true
89+
parameter_doc_comments: true
90+
param_doc_comment_if_not_inferrable: true
91+
more_specific_types_in_doc_comments: false
92+
fix_doc_comments: true
93+
verify_property_names: true
94+
verify_argument_usable_as_reference: true
95+
verify_access_scope_valid: true
96+
variable_existence: true
97+
use_statement_alias_conflict: true
98+
symfony_request_injection: true
99+
precedence_mistakes: true
100+
precedence_in_conditions: true
101+
parameter_non_unique: true
102+
no_property_on_interface: true
103+
no_non_implemented_abstract_methods: true
104+
no_duplicate_arguments: true
105+
missing_arguments: true
106+
method_calls_on_non_object: true
107+
instanceof_class_exists: true
108+
foreach_usable_as_reference: true
109+
foreach_traversable: true
110+
encourage_shallow_comparison: true
111+
closure_use_not_conflicting: true
112+
closure_use_modifiable: true
113+
catch_class_exists: true
114+
avoid_entity_manager_injection: true
115+
avoid_conflicting_incrementers: true
116+
assignment_of_null_return: true
117+
argument_type_checks: true
118+
avoid_unnecessary_concatenation: true
119+
deprecated_code_usage: true
46120
side_effects_or_types: false
121+
require_php_tag_first: true
122+
php5_style_constructor: true
123+
one_class_per_file: false
124+
no_short_open_tag: true
125+
no_global_keyword: true
126+
no_exit: false
47127
avoid_superglobals: false
128+
avoid_duplicate_types: true
129+
avoid_corrupting_byteorder_marks: true
130+
no_debug_code: true
131+
code_rating: true
48132

49-
tools:
50-
sensiolabs_security_checker: true
133+
coding_style:
134+
php:
135+
indentation:
136+
general:
137+
use_tabs: true
138+
size: 4
139+
switch:
140+
indent_case: true
141+
spaces:
142+
before_parentheses:
143+
function_declaration: false
144+
closure_definition: false
145+
function_call: false
146+
if: true
147+
for: true
148+
while: true
149+
switch: true
150+
catch: true
151+
array_initializer: false
152+
around_operators:
153+
assignment: true
154+
logical: true
155+
equality: true
156+
relational: true
157+
bitwise: true
158+
additive: true
159+
multiplicative: true
160+
shift: true
161+
unary_additive: false
162+
concatenation: true
163+
negation: true
164+
before_left_brace:
165+
class: true
166+
function: true
167+
if: true
168+
else: true
169+
for: true
170+
while: true
171+
do: true
172+
switch: true
173+
try: true
174+
catch: true
175+
finally: true
176+
before_keywords:
177+
else: true
178+
while: true
179+
catch: true
180+
finally: true
181+
within:
182+
brackets: false
183+
array_initializer: true
184+
grouping: true
185+
function_call: true
186+
function_declaration: true
187+
if: true
188+
for: true
189+
while: true
190+
switch: true
191+
catch: true
192+
type_cast: false
193+
ternary_operator:
194+
before_condition: true
195+
after_condition: true
196+
before_alternative: true
197+
after_alternative: true
198+
in_short_version: true
199+
other:
200+
before_comma: false
201+
after_comma: true
202+
before_semicolon: false
203+
after_semicolon: true
204+
after_type_cast: true
205+
braces:
206+
classes_functions:
207+
class: end-of-line
208+
function: end-of-line
209+
closure: end-of-line
210+
if:
211+
opening: end-of-line
212+
always: true
213+
else_on_new_line: false
214+
for:
215+
opening: end-of-line
216+
always: true
217+
while:
218+
opening: end-of-line
219+
always: true
220+
do_while:
221+
opening: end-of-line
222+
always: true
223+
while_on_new_line: false
224+
switch:
225+
opening: end-of-line
226+
try:
227+
opening: end-of-line
228+
catch_on_new_line: false
229+
finally_on_new_line: false
230+
upper_lower_casing:
231+
keywords:
232+
general: lower
233+
constants:
234+
true_false_null: lower

.travis.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,55 @@ sudo: false
99
language: php
1010

1111
# Declare versions of PHP to use. Use one decimal max.
12-
php:
13-
- 5.2
14-
- 5.6
15-
- hhvm
16-
12+
# @link http://docs.travis-ci.com/user/build-configuration/
1713
matrix:
18-
allow_failures:
19-
- php: hhvm
14+
fast_finish: true
15+
16+
include:
17+
# Current $required_php_version for WordPress: 5.2.4
18+
# aliased to 5.2.17
19+
- php: '5.2'
20+
# aliased to a recent 5.4.x version
21+
- php: '5.4'
22+
# aliased to a recent 5.6.x version
23+
- php: '5.6'
24+
env: SNIFF=1
25+
# aliased to a recent 7.x version
26+
- php: '7.0'
27+
# aliased to a recent hhvm version
28+
- php: 'hhvm'
29+
30+
allow_failures:
31+
- php: 'hhvm'
2032

2133
before_script:
2234
- export PHPCS_DIR=/tmp/phpcs
2335
- export WPCS_DIR=/tmp/wpcs
2436
# Install CodeSniffer for WordPress Coding Standards checks.
25-
# 2.3.1 breaks PHP 5.2 on Travis due to use of Phar class.
26-
- git clone -b 2.3.0 --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR
37+
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
2738
# Install WordPress Coding Standards.
28-
- git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR
39+
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR; fi
40+
# Hop into CodeSniffer directory.
41+
- if [[ "$SNIFF" == "1" ]]; then cd $PHPCS_DIR; fi
2942
# Set install path for WordPress Coding Standards.
3043
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
31-
- $PHPCS_DIR/scripts/phpcs --config-set installed_paths $WPCS_DIR
44+
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths $WPCS_DIR; fi
45+
# Hop back into project dir.
46+
- if [[ "$SNIFF" == "1" ]]; then cd $TRAVIS_BUILD_DIR; fi
3247
# After CodeSniffer install you should refresh your path.
33-
- phpenv rehash
48+
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi
49+
3450

3551
# Run test script commands.
3652
# All commands must exit with code 0 on success. Anything else is considered failure.
3753
script:
3854
# Search for PHP syntax errors.
39-
- find . \( -name '*.php' \) -exec php -lf {} \;
40-
# WordPress Coding Standards
55+
- find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
56+
# WordPress Coding Standards.
4157
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
4258
# @link https://github.com/squizlabs/PHP_CodeSniffer
4359
# All of the usual config flags are held in phpcs.xml
44-
- $PHPCS_DIR/scripts/phpcs
60+
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs; fi
4561

4662
notifications:
4763
email: false

0 commit comments

Comments
 (0)