WIP|FEATURE: Handle trait and interfaces beside classes
* Also fix check whether another line should be added after namespace definition. Relates: #36
This commit is contained in:
parent
fcb778d903
commit
21c72c8b96
1 changed files with 6 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue