diff --git a/src/Standards/Typo3Update/Feature/LegacyClassnameFeature.php b/src/Standards/Typo3Update/Feature/LegacyClassnameFeature.php index 72edd35..c5d27f5 100644 --- a/src/Standards/Typo3Update/Feature/LegacyClassnameFeature.php +++ b/src/Standards/Typo3Update/Feature/LegacyClassnameFeature.php @@ -194,26 +194,14 @@ class LegacyClassnameFeature implements FeatureInterface $phpcsFile->fixer->replaceToken( $classnamePosition, - $this->getTokenForReplacement($prefix . $this->getNewClassname($classname), $classname, $phpcsFile) + str_replace( + $classname, + $prefix . $this->getNewClassname($classname), + $phpcsFile->getTokens()[$classnamePosition]['content'] + ) ); } - /** - * String to use for replacing / fixing the token. - * Default is class name itself, can be overwritten in sniff for special behaviour. - * - * @param string $newClassname - * @param string $originalClassname - * @param PhpCsFile $phpcsFile - * @return string - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) We need to match the signature. - */ - protected function getTokenForReplacement($newClassname, $originalClassname, PhpCsFile $phpcsFile) - { - return $newClassname; - } - /** * Use this inside your getTokenForReplacement if $classname is inside a string. * Strings will be converted to single quotes.