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 @@ -688,7 +688,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
688688 <file baseinstalldir="PHP/CodeSniffer" name="CharacterBeforePHPOpeningTagUnitTest.2.inc" role="test" />
689689 <file baseinstalldir="PHP/CodeSniffer" name="CharacterBeforePHPOpeningTagUnitTest.3.inc" role="test" />
690690 <file baseinstalldir="PHP/CodeSniffer" name="CharacterBeforePHPOpeningTagUnitTest.php" role="test" />
691- <file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagUnitTest.inc" role="test" />
691+ <file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagUnitTest.1.inc" role="test" />
692+ <file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagUnitTest.2.inc" role="test" />
692693 <file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagUnitTest.php" role="test" />
693694 <file baseinstalldir="PHP/CodeSniffer" name="DeprecatedFunctionsUnitTest.inc" role="test" />
694695 <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
2323 */
2424 public function register ()
2525 {
26- return [T_OPEN_TAG ];
26+ return [
27+ T_OPEN_TAG ,
28+ T_OPEN_TAG_WITH_ECHO ,
29+ ];
2730
2831 }//end register()
2932
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
2121 * The key of the array should represent the line number and the value
2222 * should represent the number of errors that should occur on that line.
2323 *
24+ * @param string $testFile The name of the file being tested.
25+ *
2426 * @return array<int, int>
2527 */
26- public function getErrorList ()
28+ public function getErrorList ($ testFile = '' )
2729 {
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+ }
2940
3041 }//end getErrorList()
3142
You can’t perform that action at this time.
0 commit comments