Skip to content

Commit b2bd63a

Browse files
Merge pull request #292 from Automattic/update/add-syntax-error-sniff
Add PHP Syntax Error sniff to WordPressVIPMinimum
2 parents 6ee2440 + 9e1fdd8 commit b2bd63a

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

WordPressVIPMinimum/ruleset.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
<autoload>./PHPCSCompatibility.php</autoload>
1010

11+
<rule ref="Generic.PHP.Syntax"/>
12+
1113
<rule ref="WordPressVIPMinimum.TemplatingEngines.UnescapedOutputTwig">
1214
<include-pattern>*.twig</include-pattern>
1315
</rule>

ruleset_test.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,6 @@ include( 'non-php-file.svg' ); // NOK. Error. Including non-php file.
175175

176176
echo file_get_contents( 'non-php-file.svg' ); // XSS OK. Preferred way of including SVG/CSS file. WP_Filesystem Warning.
177177

178-
?> <!-- closing PHP tag should be omitted -->
178+
thisisasyntaxerror! // Bad. Error.
179+
180+
?> <!-- closing PHP tag should be omitted -->

ruleset_test.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
166 => 1,
5151
170 => 1,
5252
174 => 1,
53+
178 => 1,
5354
),
5455
'warnings' => array(
5556
9 => 1,

0 commit comments

Comments
 (0)