From 4fe1287247ce20cf31e41f7eda69eb0678782732 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 7 Mar 2017 13:41:36 +0100 Subject: [PATCH] TASK: Fix Scrutinizer issues --- src/Standards/Typo3Update/Sniffs/Legacy/ClassnamesSniff.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Standards/Typo3Update/Sniffs/Legacy/ClassnamesSniff.php b/src/Standards/Typo3Update/Sniffs/Legacy/ClassnamesSniff.php index 16cc3d2..2cf11d0 100644 --- a/src/Standards/Typo3Update/Sniffs/Legacy/ClassnamesSniff.php +++ b/src/Standards/Typo3Update/Sniffs/Legacy/ClassnamesSniff.php @@ -45,7 +45,7 @@ class Typo3Update_Sniffs_Legacy_ClassnamesSniff implements PHP_CodeSniffer_Sniff * * @see http://php.net/manual/en/tokens.php * - * @return array(int) + * @return array */ public function register() { @@ -74,6 +74,10 @@ class Typo3Update_Sniffs_Legacy_ClassnamesSniff implements PHP_CodeSniffer_Sniff $classnamePosition = $phpcsFile->findNext(T_STRING, $stackPtr); $classname = $tokens[$classnamePosition]['content']; + if ($classnamePosition === false) { + return; + } + if ($this->isLegacyClassname($classname)) { $fix = $phpcsFile->addFixableError( 'Legacy classes are not allowed; found %s',