Skip to content

Commit

Permalink
Add rule to prohibit the use of the backtick shell execution operator…
Browse files Browse the repository at this point in the history
… to `extra`.

Execution of shell commands should be discouraged. A number of the other commands along the same lines are discouraged via function sniffs, however, the backtick operator was so far ignored.

For this sniff to be added, the minimum PHPCS version needs to be upped as it has only just been added in the latest release.

See: squizlabs/PHP_CodeSniffer#1073
  • Loading branch information
jrfnl committed Jul 28, 2016
1 parent 9d0d32d commit f585698
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ php:

env:
- PHPCS_BRANCH=master
- PHPCS_BRANCH=2.6.0
- PHPCS_BRANCH=2.7.0

matrix:
fast_finish: true
Expand Down
1 change: 1 addition & 0 deletions WordPress-Extra/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.BacktickOperator"/>
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require" : {
"squizlabs/php_codesniffer": "^2.6"
"squizlabs/php_codesniffer": "^2.7"
},
"minimum-stability" : "RC",
"support" : {
Expand Down

0 comments on commit f585698

Please sign in to comment.