File tree Expand file tree Collapse file tree 5 files changed +21
-4
lines changed Expand file tree Collapse file tree 5 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -729,7 +729,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
729729 <file baseinstalldir="PHP/CodeSniffer" name="RequireStrictTypesUnitTest.php" role="test" />
730730 <file baseinstalldir="PHP/CodeSniffer" name="SAPIUsageUnitTest.inc" role="test" />
731731 <file baseinstalldir="PHP/CodeSniffer" name="SAPIUsageUnitTest.php" role="test" />
732- <file baseinstalldir="PHP/CodeSniffer" name="SyntaxUnitTest.inc" role="test" />
732+ <file baseinstalldir="PHP/CodeSniffer" name="SyntaxUnitTest.1.inc" role="test" />
733+ <file baseinstalldir="PHP/CodeSniffer" name="SyntaxUnitTest.2.inc" role="test" />
733734 <file baseinstalldir="PHP/CodeSniffer" name="SyntaxUnitTest.php" role="test" />
734735 <file baseinstalldir="PHP/CodeSniffer" name="UpperCaseConstantUnitTest.inc" role="test" />
735736 <file baseinstalldir="PHP/CodeSniffer" name="UpperCaseConstantUnitTest.inc.fixed" role="test" />
Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ class SyntaxSniff implements Sniff
3333 */
3434 public function register ()
3535 {
36- return [T_OPEN_TAG ];
36+ return [
37+ T_OPEN_TAG ,
38+ T_OPEN_TAG_WITH_ECHO ,
39+ ];
3740
3841 }//end register()
3942
File renamed without changes.
Original file line number Diff line number Diff line change 1+ <?= 'text ' ?>
2+ <div>text</div>
3+ <?= if ($ x ) { $ y = 'text ' ; } ?>
Original file line number Diff line number Diff line change @@ -22,11 +22,21 @@ class SyntaxUnitTest extends AbstractSniffUnitTest
2222 * The key of the array should represent the line number and the value
2323 * should represent the number of errors that should occur on that line.
2424 *
25+ * @param string $testFile The name of the file being tested.
26+ *
2527 * @return array<int, int>
2628 */
27- public function getErrorList ()
29+ public function getErrorList ($ testFile = '' )
2830 {
29- return [3 => 1 ];
31+ switch ($ testFile ) {
32+ case 'SyntaxUnitTest.1.inc ' :
33+ case 'SyntaxUnitTest.2.inc ' :
34+ return [3 => 1 ];
35+ break ;
36+ default :
37+ return [];
38+ break ;
39+ }
3040
3141 }//end getErrorList()
3242
You can’t perform that action at this time.
0 commit comments