Skip to content

Commit c13df57

Browse files
committed
Add RemoveSetterGetterDocblockFixer
1 parent 556e579 commit c13df57

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,25 @@ Fixes @param, @return, `@var` and inline `@var` annotations broken formats
145145

146146
<br>
147147

148+
## RemoveSetterGetterDocblockFixer
149+
150+
Remove docblock description from getter/setter methods, that only repeats the method name
151+
152+
- class: [`Symplify\CodingStandard\Fixer\Annotation\RemoveSetterGetterDocblockFixer`](../src/Fixer/Annotation/RemoveSetterGetterDocblockFixer.php)
153+
154+
```diff
155+
/**
156+
- * Get name
157+
*
158+
* @return string
159+
*/
160+
function getName()
161+
{
162+
}
163+
```
164+
165+
<br>
166+
148167
## RemovePHPStormAnnotationFixer
149168

150169
Remove "Created by PhpStorm" annotations

config/symplify.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
66
use Symplify\CodingStandard\Fixer\Annotation\RemovePHPStormAnnotationFixer;
7+
use Symplify\CodingStandard\Fixer\Annotation\RemoveSetterGetterDocblockFixer;
78
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayListItemNewlineFixer;
89
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer;
910
use Symplify\CodingStandard\Fixer\Commenting\ParamReturnAndVarTagMalformsFixer;
@@ -21,6 +22,7 @@
2122
RemovePHPStormAnnotationFixer::class,
2223
ParamReturnAndVarTagMalformsFixer::class,
2324
RemoveUselessDefaultCommentFixer::class,
25+
RemoveSetterGetterDocblockFixer::class,
2426

2527
// arrays
2628
ArrayListItemNewlineFixer::class,

src/Fixer/Annotation/RemoveSetterGetterDocblockFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class RemoveSetterGetterDocblockFixer extends AbstractSymplifyFixer
2424
*/
2525
private const ERROR_MESSAGE = 'Remove setter and getter only docblocks';
2626

27-
private MethodNameResolver $methodNameResolver;
27+
private readonly MethodNameResolver $methodNameResolver;
2828

2929
public function __construct(
3030
private readonly TokenReverser $tokenReverser

0 commit comments

Comments
 (0)