Skip to content

Commit 742d85b

Browse files
authored
Merge pull request #89 from PHPCSStandards/feature/bcfile-getmethodproperties-minor-tweak
BCFile::getMethodProperties(): minor code tweak
2 parents 69d85ab + b030166 commit 742d85b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PHPCSUtils/BackCompat/BCFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,12 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
667667
$bodyTokens = [T_DOUBLE_ARROW => T_DOUBLE_ARROW];
668668
if (defined('T_FN_ARROW') === true) {
669669
// PHPCS 3.5.3+.
670-
$bodyTokens = [T_FN_ARROW => T_FN_ARROW];
670+
$bodyTokens[T_FN_ARROW] = T_FN_ARROW;
671671
}
672672
}
673673

674674
$end = $phpcsFile->findNext(($bodyTokens + [T_SEMICOLON]), $parenthesisCloser);
675-
$hasBody = isset($bodyTokens[$tokens[$end]['code']]);
675+
$hasBody = ($end !== false && isset($bodyTokens[$tokens[$end]['code']]));
676676
}
677677

678678
if ($returnType !== '' && $nullableReturnType === true) {

0 commit comments

Comments
 (0)