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">
729
729
<file baseinstalldir="PHP/CodeSniffer" name="RequireStrictTypesUnitTest.php" role="test" />
730
730
<file baseinstalldir="PHP/CodeSniffer" name="SAPIUsageUnitTest.inc" role="test" />
731
731
<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" />
733
734
<file baseinstalldir="PHP/CodeSniffer" name="SyntaxUnitTest.php" role="test" />
734
735
<file baseinstalldir="PHP/CodeSniffer" name="UpperCaseConstantUnitTest.inc" role="test" />
735
736
<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
33
33
*/
34
34
public function register ()
35
35
{
36
- return [T_OPEN_TAG ];
36
+ return [
37
+ T_OPEN_TAG ,
38
+ T_OPEN_TAG_WITH_ECHO ,
39
+ ];
37
40
38
41
}//end register()
39
42
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
22
22
* The key of the array should represent the line number and the value
23
23
* should represent the number of errors that should occur on that line.
24
24
*
25
+ * @param string $testFile The name of the file being tested.
26
+ *
25
27
* @return array<int, int>
26
28
*/
27
- public function getErrorList ()
29
+ public function getErrorList ($ testFile = '' )
28
30
{
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
+ }
30
40
31
41
}//end getErrorList()
32
42
You can’t perform that action at this time.
0 commit comments