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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy