TASK: Fix Scrutinizer issues

This commit is contained in:
Daniel Siepmann 2017-03-07 13:41:36 +01:00
parent f912313da3
commit 4fe1287247
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -45,7 +45,7 @@ class Typo3Update_Sniffs_Legacy_ClassnamesSniff implements PHP_CodeSniffer_Sniff
* *
* @see http://php.net/manual/en/tokens.php * @see http://php.net/manual/en/tokens.php
* *
* @return array(int) * @return array<int>
*/ */
public function register() public function register()
{ {
@ -74,6 +74,10 @@ class Typo3Update_Sniffs_Legacy_ClassnamesSniff implements PHP_CodeSniffer_Sniff
$classnamePosition = $phpcsFile->findNext(T_STRING, $stackPtr); $classnamePosition = $phpcsFile->findNext(T_STRING, $stackPtr);
$classname = $tokens[$classnamePosition]['content']; $classname = $tokens[$classnamePosition]['content'];
if ($classnamePosition === false) {
return;
}
if ($this->isLegacyClassname($classname)) { if ($this->isLegacyClassname($classname)) {
$fix = $phpcsFile->addFixableError( $fix = $phpcsFile->addFixableError(
'Legacy classes are not allowed; found %s', 'Legacy classes are not allowed; found %s',