From ae3ff6c2e1e58cbc862a9eb86f9390c634188bc8 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Fri, 27 May 2016 12:49:25 +0200 Subject: [PATCH] Fixed undefined variable according to PHPStan --- .../Sniffs/Typehints/ReturnTypehintSpacingSniff.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SlevomatCodingStandard/Sniffs/Typehints/ReturnTypehintSpacingSniff.php b/SlevomatCodingStandard/Sniffs/Typehints/ReturnTypehintSpacingSniff.php index b5e6b4ee1..077fe367c 100644 --- a/SlevomatCodingStandard/Sniffs/Typehints/ReturnTypehintSpacingSniff.php +++ b/SlevomatCodingStandard/Sniffs/Typehints/ReturnTypehintSpacingSniff.php @@ -43,6 +43,8 @@ public function process(\PHP_CodeSniffer_File $phpcsFile, $returnTypePointer) $phpcsFile->addError($afterColonMessage, $returnTypePointer, self::CODE_MULTIPLE_SPACES_BETWEEN_COLON_AND_TYPE); } $colonPointer = $phpcsFile->findPrevious(T_COLON, $beforeNamePointer - 1); + } else { + return; } $previousPointer = $colonPointer - 1;