Skip to content

Commit 3987530

Browse files
author
roettigl
committed
#147: Fix for files that contain phtml
1 parent 8aa173c commit 3987530

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Magento2/Sniffs/Templates/ThisInTemplateSniff.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public function register()
5454
*/
5555
public function process(File $phpcsFile, $stackPtr)
5656
{
57+
if (strpos($phpcsFile->getFilename(), '.php', -4) !== false) {
58+
// file is from type .php do nothing
59+
return;
60+
}
61+
5762
$tokens = $phpcsFile->getTokens();
5863
if ($tokens[$stackPtr]['content'] === '$this') {
5964
$position = $phpcsFile->findNext(T_STRING, $stackPtr, null, false, 'helper', true);

0 commit comments

Comments
 (0)