Merge pull request #32 from DanielSiepmann/hotfix/fix-static-call-sniff
BUGFIX: Fix bug introduced in e6e372f8b1
This commit is contained in:
commit
f1b6cc86c1
2 changed files with 25 additions and 0 deletions
|
@ -56,6 +56,17 @@ trait ClassnameCheckerTrait
|
||||||
$this->legacyClassnames = $legacyClassnames['aliasToClassNameMapping'];
|
$this->legacyClassnames = $legacyClassnames['aliasToClassNameMapping'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define whether the T_STRING default behaviour should be checked before
|
||||||
|
* or after the $stackPtr.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function findPrev()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes the tokens that this sniff is interested in.
|
* Processes the tokens that this sniff is interested in.
|
||||||
*
|
*
|
||||||
|
@ -74,6 +85,9 @@ trait ClassnameCheckerTrait
|
||||||
$tokens = $phpcsFile->getTokens();
|
$tokens = $phpcsFile->getTokens();
|
||||||
|
|
||||||
$classnamePosition = $phpcsFile->findNext(T_STRING, $stackPtr);
|
$classnamePosition = $phpcsFile->findNext(T_STRING, $stackPtr);
|
||||||
|
if ($this->findPrev()) {
|
||||||
|
$classnamePosition = $phpcsFile->findPrevious(T_STRING, $stackPtr);
|
||||||
|
}
|
||||||
if ($classnamePosition === false) {
|
if ($classnamePosition === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,17 @@ class Typo3Update_Sniffs_LegacyClassnames_StaticCallSniff implements PHP_CodeSni
|
||||||
{
|
{
|
||||||
use \Typo3Update\Sniffs\LegacyClassnames\ClassnameCheckerTrait;
|
use \Typo3Update\Sniffs\LegacyClassnames\ClassnameCheckerTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define whether the T_STRING default behaviour should be checked before
|
||||||
|
* or after the $stackPtr.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function findPrev()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the token types that this sniff is interested in.
|
* Returns the token types that this sniff is interested in.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue