$class .= $tokens[$i]['content'];
}
- $extends = $phpcsFile->findPrevious(array(T_EXTENDS), $stackPtr - 1, null, false, null, true);
+ $tClass = $phpcsFile->findPrevious(array(T_CLASS), $stackPtr - 1);
// are we trying to extend a class with the same name?
- if ($extends !== false) {
- $newClass = $phpcsFile->findPrevious(T_STRING, $extends);
+ if ($tClass !== false) {
+ $newClass = $phpcsFile->findNext(T_STRING, $tClass);
if ($tokens[$newClass]['content'] == $tokens[$end - 1]['content']) return;
}