Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

Commit d8f8fe2

Browse files
committed
Fixed issue with unreachable $type variable.
1 parent b6f54ef commit d8f8fe2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

CodeIgniter4/Sniffs/Files/FilenameMatchesClassSniff.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ public function process(File $phpcsFile, $stackPtr)
6969
return;
7070
}
7171

72-
$className = trim($phpcsFile->getDeclarationName($stackPtr));
73-
72+
$className = trim($phpcsFile->getDeclarationName($stackPtr));
7473
$nextContentPtr = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
74+
$type = $tokens[$stackPtr]['content'];
7575

7676
if ($fileName !== $className.'.php' && $this->badFilename === false) {
77-
$type = $tokens[$stackPtr]['content'];
7877
$data = array(
7978
$fileName,
8079
$className.'.php',

0 commit comments

Comments
 (0)