Skip to content

Commit

Permalink
Add interface support for dead docblock (#51)
Browse files Browse the repository at this point in the history
* add interface fixture

* add docblock support for interface removal
  • Loading branch information
TomasVotruba authored Jul 21, 2024
1 parent b235832 commit 8a14f92
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DocBlock/UselessDocBlockCleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ final class UselessDocBlockCleaner
* @see https://regex101.com/r/RzTdFH/4
* @var string
*/
private const STANDALONE_COMMENT_CLASS_REGEX = '#\/\/\s+([cC]lass|[tT]rait)\s+\w+$#';
private const STANDALONE_COMMENT_CLASS_REGEX = '#\/\/\s+(class|trait|interface)\s+\w+$#i';

/**
* @see https://regex101.com/r/RzTdFH/4
* @var string
*/
private const INLINE_COMMENT_CLASS_REGEX = '#( \*|\/\/)\s+([cC]lass|[tT]rait)\s+(\w+)\n#';
private const INLINE_COMMENT_CLASS_REGEX = '#( \*|\/\/)\s+(class|trait|interface)\s+(\w+)\n#i';

/**
* @see https://regex101.com/r/bzbxXz/2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemoveUselessDefaultCommentFixer\Fixture;

/**
* Interface SomeInterface
*/
interface SomeInterface
{
}

?>
-----
<?php

namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemoveUselessDefaultCommentFixer\Fixture;

/**
*/
interface SomeInterface
{
}

?>

0 comments on commit 8a14f92

Please sign in to comment.