Skip to content

Commit b7c053f

Browse files
authored
Merge pull request #247 from magento-commerce/imported-isaaceindhoven-magento-coding-standard-378
[Imported] Add semicolon as statement separator in the special annotation check of the `Magento2.Security.XssTemplate` sniff
2 parents 6e8b466 + 21db432 commit b7c053f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Magento2/Sniffs/Security/XssTemplateSniff.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ public function process(File $phpcsFile, $stackPtr)
147147
private function findSpecialAnnotation($stackPtr)
148148
{
149149
if ($this->tokens[$stackPtr]['code'] === T_ECHO) {
150-
$startOfStatement = $this->file->findPrevious(T_OPEN_TAG, $stackPtr);
150+
$startOfStatement = $this->file->findPrevious([T_OPEN_TAG, T_SEMICOLON], $stackPtr);
151151
return $this->file->findPrevious(T_COMMENT, $stackPtr, $startOfStatement);
152152
}
153153
if ($this->tokens[$stackPtr]['code'] === T_OPEN_TAG_WITH_ECHO) {
154-
$endOfStatement = $this->file->findNext(T_CLOSE_TAG, $stackPtr);
154+
$endOfStatement = $this->file->findNext([T_CLOSE_TAG, T_SEMICOLON], $stackPtr);
155155
return $this->file->findNext(T_COMMENT, $stackPtr, $endOfStatement);
156156
}
157157
return false;

0 commit comments

Comments
 (0)