123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- =====================
- Rule ``phpdoc_align``
- =====================
- All items of the given phpdoc tags must be either left-aligned or (by default)
- aligned vertically.
- Configuration
- -------------
- ``tags``
- ~~~~~~~~
- The tags that should be aligned.
- Allowed types: ``array``
- Default value: ``['method', 'param', 'property', 'return', 'throws', 'type', 'var']``
- ``align``
- ~~~~~~~~~
- How comments should be aligned.
- Allowed values: ``'left'``, ``'vertical'``
- Default value: ``'vertical'``
- Examples
- --------
- Example #1
- ~~~~~~~~~~
- *Default* configuration.
- .. code-block:: diff
- --- Original
- +++ New
- <?php
- /**
- - * @param EngineInterface $templating
- - * @param string $format
- - * @param int $code an HTTP response status code
- - * @param bool $debug
- - * @param mixed &$reference a parameter passed by reference
- + * @param EngineInterface $templating
- + * @param string $format
- + * @param int $code an HTTP response status code
- + * @param bool $debug
- + * @param mixed &$reference a parameter passed by reference
- */
- Example #2
- ~~~~~~~~~~
- With configuration: ``['align' => 'vertical']``.
- .. code-block:: diff
- --- Original
- +++ New
- <?php
- /**
- - * @param EngineInterface $templating
- - * @param string $format
- - * @param int $code an HTTP response status code
- - * @param bool $debug
- - * @param mixed &$reference a parameter passed by reference
- + * @param EngineInterface $templating
- + * @param string $format
- + * @param int $code an HTTP response status code
- + * @param bool $debug
- + * @param mixed &$reference a parameter passed by reference
- */
- Example #3
- ~~~~~~~~~~
- With configuration: ``['align' => 'left']``.
- .. code-block:: diff
- --- Original
- +++ New
- <?php
- /**
- - * @param EngineInterface $templating
- - * @param string $format
- - * @param int $code an HTTP response status code
- - * @param bool $debug
- - * @param mixed &$reference a parameter passed by reference
- + * @param EngineInterface $templating
- + * @param string $format
- + * @param int $code an HTTP response status code
- + * @param bool $debug
- + * @param mixed &$reference a parameter passed by reference
- */
- Rule sets
- ---------
- The rule is part of the following rule sets:
- @PhpCsFixer
- Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``phpdoc_align`` rule with the default config.
- @Symfony
- Using the `@Symfony <./../../ruleSets/Symfony.rst>`_ rule set will enable the ``phpdoc_align`` rule with the default config.
|