Skip to content

Commit 501aa1e

Browse files
authored
Merge pull request #124 from bmitch/bmitchell-123
Fixes #123 - MixedReturnTypeSniff - check for `comment_opener` index …
2 parents 02bc0ed + 4cb6a28 commit 501aa1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Codor/Sniffs/TypeHints/MixedReturnTypeSniff.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
3636

3737
$commentEnd = $this->findCommentEnd($phpcsFile, $stackPtr, $tokens);
3838

39+
if (empty($tokens[$commentEnd]['comment_opener'])) {
40+
return;
41+
}
42+
3943
$commentStart = $tokens[$commentEnd]['comment_opener'];
4044

4145
$this->processReturn($phpcsFile, $commentStart);

0 commit comments

Comments
 (0)