diff --git a/package.xml b/package.xml index f12183533c..00ff8ebff5 100644 --- a/package.xml +++ b/package.xml @@ -688,7 +688,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> - + + diff --git a/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php b/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php index e59ed5ffa7..d03bf8abe1 100644 --- a/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php +++ b/src/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php @@ -23,7 +23,10 @@ class ClosingPHPTagSniff implements Sniff */ public function register() { - return [T_OPEN_TAG]; + return [ + T_OPEN_TAG, + T_OPEN_TAG_WITH_ECHO, + ]; }//end register() diff --git a/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.inc b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.1.inc similarity index 100% rename from src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.inc rename to src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.1.inc diff --git a/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.2.inc b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.2.inc new file mode 100644 index 0000000000..fc896ed197 --- /dev/null +++ b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.2.inc @@ -0,0 +1,5 @@ + +Bold text + +Italic text + */ - public function getErrorList() + public function getErrorList($testFile='') { - return [9 => 1]; + switch ($testFile) { + case 'ClosingPHPTagUnitTest.1.inc': + return [9 => 1]; + case 'ClosingPHPTagUnitTest.2.inc': + return [5 => 1]; + break; + default: + return []; + break; + } }//end getErrorList()