diff --git a/src/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingNamespaceSniff.php b/src/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingNamespaceSniff.php index 2d74d70..391c357 100644 --- a/src/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingNamespaceSniff.php +++ b/src/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingNamespaceSniff.php @@ -34,7 +34,11 @@ class Typo3Update_Sniffs_LegacyClassnames_MissingNamespaceSniff extends Abstract */ public function register() { - return [T_CLASS]; + return [ + T_CLASS, + T_INTERFACE, + T_TRAIT, + ]; } /** @@ -97,8 +101,7 @@ class Typo3Update_Sniffs_LegacyClassnames_MissingNamespaceSniff extends Abstract $lineEndings = PhpCsFile::detectLineEndings($phpcsFile->getFilename()); $suffix = $lineEndings; - // TODO, does not work. - if ($tokens[1] === "\n") { + if ($tokens[1]['code'] !== T_WHITESPACE) { $suffix .= $lineEndings; }