TASK: Fix Scrutinizer issues
This commit is contained in:
parent
f912313da3
commit
4fe1287247
1 changed files with 5 additions and 1 deletions
|
@ -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',
|
||||||
|
|
Loading…
Reference in a new issue