FEATURE: Already save classname alias while searching
* To improve report results even during searching. * By moving namespace mapping to search from fixing.
This commit is contained in:
parent
413d8e45f5
commit
40be6732af
1 changed files with 5 additions and 4 deletions
|
@ -67,6 +67,11 @@ class Typo3Update_Sniffs_LegacyClassname_MissingNamespaceSniff implements PhpCsS
|
|||
}
|
||||
|
||||
$classname = $tokens[$classnamePosition]['content'];
|
||||
|
||||
LegacyClassnameMapping::getInstance()->addLegacyClassname(
|
||||
$classname,
|
||||
$this->getNamespace($classname) . '\\' . $this->getNewClassname($classname)
|
||||
);
|
||||
$fix = $phpcsFile->addFixableError(
|
||||
'Legacy class definitions are not allowed; found "%s".'
|
||||
. ' Wrap your class inside a namespace.',
|
||||
|
@ -106,10 +111,6 @@ class Typo3Update_Sniffs_LegacyClassname_MissingNamespaceSniff implements PhpCsS
|
|||
$this->getNamespacePosition($phpcsFile),
|
||||
'<?php' . $lineEndings . $this->getNamespaceDefinition($classname) . $suffix
|
||||
);
|
||||
LegacyClassnameMapping::getInstance()->addLegacyClassname(
|
||||
$classname,
|
||||
$this->getNamespace($classname) . '\\' . $this->getNewClassname($classname)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue