Skip to content

Commit 3c62979

Browse files
authored
Merge pull request #416 from cakephp/5.x-fix-error
fix error with change in slevomat/coding-standard 8.19.0
2 parents 017b827 + 878798d commit 3c62979

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CakePHP/Sniffs/Classes/ReturnTypeHintSniff.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ protected function getClassNameWithNamespace(File $phpCsFile): ?string
228228
return null;
229229
}
230230

231-
$classPointer = $phpCsFile->findPrevious(TokenHelper::$typeKeywordTokenCodes, $lastToken);
231+
$classPointer = $phpCsFile->findPrevious(
232+
[T_CLASS, T_TRAIT, T_INTERFACE, T_ENUM],
233+
$lastToken,
234+
);
232235
if (!$classPointer) {
233236
return null;
234237
}

0 commit comments

Comments
 (0)