Skip to content

Commit 8a14f92

Browse files
authored
Add interface support for dead docblock (#51)
* add interface fixture * add docblock support for interface removal
1 parent b235832 commit 8a14f92

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|[tT]rait)\s+\w+$#';
50+
private const STANDALONE_COMMENT_CLASS_REGEX = '#\/\/\s+(class|trait|interface)\s+\w+$#i';
5151

5252
/**
5353
* @see https://regex101.com/r/RzTdFH/4
5454
* @var string
5555
*/
56-
private const INLINE_COMMENT_CLASS_REGEX = '#( \*|\/\/)\s+([cC]lass|[tT]rait)\s+(\w+)\n#';
56+
private const INLINE_COMMENT_CLASS_REGEX = '#( \*|\/\/)\s+(class|trait|interface)\s+(\w+)\n#i';
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+
* Interface SomeInterface
7+
*/
8+
interface SomeInterface
9+
{
10+
}
11+
12+
?>
13+
-----
14+
<?php
15+
16+
namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemoveUselessDefaultCommentFixer\Fixture;
17+
18+
/**
19+
*/
20+
interface SomeInterface
21+
{
22+
}
23+
24+
?>

0 commit comments

Comments
 (0)