We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
NoUselessCommentFixer
1 parent 973fc24 commit ec9776eCopy full SHA for ec9776e
src/Fixer/NoUselessCommentFixer.php
@@ -101,6 +101,10 @@ private static function getNewContent(Tokens $tokens, int $index): string
101
$classyNameIndex = $tokens->getNextMeaningfulToken($nextIndex);
102
\assert(\is_int($classyNameIndex));
103
104
+ if (!$tokens[$classyNameIndex]->isGivenKind(\T_STRING)) {
105
+ return $content;
106
+ }
107
+
108
$content = Preg::replace(
109
\sprintf('~
110
\\R?
tests/Fixer/NoUselessCommentFixerTest.php
@@ -464,5 +464,11 @@ class Bar {}
464
// foo
465
',
466
];
467
468
+ yield [
469
+ '<?php
470
+ $a = new /** ( */ class () {};
471
+ ',
472
+ ];
473
}
474
0 commit comments