Skip to content

Commit b235832

Browse files
authored
Add interface comment removal as well (#50)
* add fixture with trait * fixup! add fixture with trait * add trait support
1 parent ab6256a commit b235832

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/DocBlock/UselessDocBlockCleaner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ final class UselessDocBlockCleaner
4747
* @see https://regex101.com/r/RzTdFH/4
4848
* @var string
4949
*/
50-
private const STANDALONE_COMMENT_CLASS_REGEX = '#\/\/\s+[cC]lass\s+\w+$#';
50+
private const STANDALONE_COMMENT_CLASS_REGEX = '#\/\/\s+([cC]lass|[tT]rait)\s+\w+$#';
5151

5252
/**
5353
* @see https://regex101.com/r/RzTdFH/4
5454
* @var string
5555
*/
56-
private const INLINE_COMMENT_CLASS_REGEX = '#( \*|\/\/)\s+[cC]lass\s+(\w+)\n#';
56+
private const INLINE_COMMENT_CLASS_REGEX = '#( \*|\/\/)\s+([cC]lass|[tT]rait)\s+(\w+)\n#';
5757

5858
/**
5959
* @see https://regex101.com/r/bzbxXz/2
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemoveUselessDefaultCommentFixer\Fixture;
4+
5+
/**
6+
* Trait SomeTrait
7+
*/
8+
trait SomeTrait
9+
{
10+
}
11+
12+
?>
13+
-----
14+
<?php
15+
16+
namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemoveUselessDefaultCommentFixer\Fixture;
17+
18+
/**
19+
*/
20+
trait SomeTrait
21+
{
22+
}
23+
24+
?>

0 commit comments

Comments
 (0)