File tree Expand file tree Collapse file tree 5 files changed +24
-4
lines changed Expand file tree Collapse file tree 5 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -664,7 +664,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
664
664
<file baseinstalldir="PHP/CodeSniffer" name="CharacterBeforePHPOpeningTagUnitTest.2.inc" role="test" />
665
665
<file baseinstalldir="PHP/CodeSniffer" name="CharacterBeforePHPOpeningTagUnitTest.3.inc" role="test" />
666
666
<file baseinstalldir="PHP/CodeSniffer" name="CharacterBeforePHPOpeningTagUnitTest.php" role="test" />
667
- <file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagUnitTest.inc" role="test" />
667
+ <file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagUnitTest.1.inc" role="test" />
668
+ <file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagUnitTest.2.inc" role="test" />
668
669
<file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagUnitTest.php" role="test" />
669
670
<file baseinstalldir="PHP/CodeSniffer" name="DeprecatedFunctionsUnitTest.inc" role="test" />
670
671
<file baseinstalldir="PHP/CodeSniffer" name="DeprecatedFunctionsUnitTest.php" role="test" />
Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ class ClosingPHPTagSniff implements Sniff
23
23
*/
24
24
public function register ()
25
25
{
26
- return [T_OPEN_TAG ];
26
+ return [
27
+ T_OPEN_TAG ,
28
+ T_OPEN_TAG_WITH_ECHO ,
29
+ ];
27
30
28
31
}//end register()
29
32
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ <?= 'foo ' ; ?>
2
+ <b>Bold text</b>
3
+ <?= 'bar ' ; ?>
4
+ <i>Italic text</i>
5
+ <?= 'baz ' ;
Original file line number Diff line number Diff line change @@ -21,11 +21,22 @@ class ClosingPHPTagUnitTest extends AbstractSniffUnitTest
21
21
* The key of the array should represent the line number and the value
22
22
* should represent the number of errors that should occur on that line.
23
23
*
24
+ * @param string $testFile The name of the file being tested.
25
+ *
24
26
* @return array<int, int>
25
27
*/
26
- public function getErrorList ()
28
+ public function getErrorList ($ testFile = '' )
27
29
{
28
- return [9 => 1 ];
30
+ switch ($ testFile ) {
31
+ case 'ClosingPHPTagUnitTest.1.inc ' :
32
+ return [9 => 1 ];
33
+ case 'ClosingPHPTagUnitTest.2.inc ' :
34
+ return [5 => 1 ];
35
+ break ;
36
+ default :
37
+ return [];
38
+ break ;
39
+ }
29
40
30
41
}//end getErrorList()
31
42
You can’t perform that action at this time.
0 commit comments