Skip to content

Latest commit

 

History

History
87 lines (63 loc) · 1.45 KB

phpdoc_add_missing_param_annotation.rst

File metadata and controls

87 lines (63 loc) · 1.45 KB

Rule phpdoc_add_missing_param_annotation

PHPDoc should contain @param for all params.

Configuration

only_untyped

Whether to add missing @param annotations for untyped parameters only.

Allowed types: bool

Default value: true

Examples

Example #1

Default configuration.

--- Original
+++ New
 <?php
 /**
  * @param int $bar
+ * @param mixed $baz
  *
  * @return void
  */
 function f9(string $foo, $bar, $baz) {}

Example #2

With configuration: ['only_untyped' => true].

--- Original
+++ New
 <?php
 /**
  * @param int $bar
+ * @param mixed $baz
  *
  * @return void
  */
 function f9(string $foo, $bar, $baz) {}

Example #3

With configuration: ['only_untyped' => false].

--- Original
+++ New
 <?php
 /**
  * @param int $bar
+ * @param string $foo
+ * @param mixed $baz
  *
  * @return void
  */
 function f9(string $foo, $bar, $baz) {}

Rule sets

The rule is part of the following rule set:

Source class

PhpCsFixer\Fixer\Phpdoc\PhpdocAddMissingParamAnnotationFixer