1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- ============================================
- 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.
- .. code-block:: diff
- --- Original
- +++ New
- <?php
- /**
- * @param int $bar
- + * @param mixed $baz
- *
- * @return void
- */
- function f9(string $foo, $bar, $baz) {}
- Example #2
- ~~~~~~~~~~
- With configuration: ``['only_untyped' => true]``.
- .. code-block:: diff
- --- Original
- +++ New
- <?php
- /**
- * @param int $bar
- + * @param mixed $baz
- *
- * @return void
- */
- function f9(string $foo, $bar, $baz) {}
- Example #3
- ~~~~~~~~~~
- With configuration: ``['only_untyped' => false]``.
- .. code-block:: diff
- --- 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:
- - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
|