Removes @param
, @return
and @var
tags that don't provide any useful
information.
allow_hidden_params
Whether param
annotation for hidden params in method signature are allowed.
Allowed types: bool
Default value: false
Whether type mixed
without description is allowed (true
) or considered
superfluous (false
).
Allowed types: bool
Default value: false
Whether param
annotation without actual signature is allowed (true
) or
considered superfluous (false
).
Allowed types: bool
Default value: false
Remove @inheritDoc
tags.
Allowed types: bool
Default value: false
Default configuration.
--- Original
+++ New
<?php
class Foo {
/**
- * @param Bar $bar
- * @param mixed $baz
*
- * @return Baz
*/
public function doFoo(Bar $bar, $baz): Baz {}
}
With configuration: ['allow_mixed' => true]
.
--- Original
+++ New
<?php
class Foo {
/**
- * @param Bar $bar
* @param mixed $baz
*/
public function doFoo(Bar $bar, $baz) {}
}
With configuration: ['remove_inheritdoc' => true]
.
--- Original
+++ New
<?php
class Foo {
/**
- * @inheritDoc
+ *
*/
public function doFoo(Bar $bar, $baz) {}
}
With configuration: ['allow_hidden_params' => true]
.
--- Original
+++ New
<?php
class Foo {
/**
- * @param Bar $bar
- * @param mixed $baz
* @param string|int|null $qux
- * @param mixed $foo
*/
public function doFoo(Bar $bar, $baz /*, $qux = null */) {}
}
With configuration: ['allow_unused_params' => true]
.
--- Original
+++ New
<?php
class Foo {
/**
- * @param Bar $bar
- * @param mixed $baz
* @param string|int|null $qux
* @param mixed $foo
*/
public function doFoo(Bar $bar, $baz /*, $qux = null */) {}
}
The rule is part of the following rule sets:
@PhpCsFixer with config:
['allow_mixed' => true, 'remove_inheritdoc' => true]
@Symfony with config:
['allow_hidden_params' => true, 'remove_inheritdoc' => true]
- Fixer class: PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer
- Test class: PhpCsFixer\Tests\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.