phpdoc_line_span.rst 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. =========================
  2. Rule ``phpdoc_line_span``
  3. =========================
  4. Changes doc blocks from single to multi line, or reversed. Works for class
  5. constants, properties and methods only.
  6. Configuration
  7. -------------
  8. ``const``
  9. ~~~~~~~~~
  10. Whether const blocks should be single or multi line.
  11. Allowed values: ``'multi'``, ``'single'`` and ``null``
  12. Default value: ``'multi'``
  13. ``method``
  14. ~~~~~~~~~~
  15. Whether method doc blocks should be single or multi line.
  16. Allowed values: ``'multi'``, ``'single'`` and ``null``
  17. Default value: ``'multi'``
  18. ``property``
  19. ~~~~~~~~~~~~
  20. Whether property doc blocks should be single or multi line.
  21. Allowed values: ``'multi'``, ``'single'`` and ``null``
  22. Default value: ``'multi'``
  23. Examples
  24. --------
  25. Example #1
  26. ~~~~~~~~~~
  27. *Default* configuration.
  28. .. code-block:: diff
  29. --- Original
  30. +++ New
  31. <?php
  32. class Foo{
  33. - /** @var bool */
  34. + /**
  35. + * @var bool
  36. + */
  37. public $var;
  38. }
  39. Example #2
  40. ~~~~~~~~~~
  41. With configuration: ``['property' => 'single']``.
  42. .. code-block:: diff
  43. --- Original
  44. +++ New
  45. <?php
  46. class Foo{
  47. - /**
  48. - * @var bool
  49. - */
  50. + /** @var bool */
  51. public $var;
  52. }
  53. References
  54. ----------
  55. - Fixer class: `PhpCsFixer\\Fixer\\Phpdoc\\PhpdocLineSpanFixer <./../../../src/Fixer/Phpdoc/PhpdocLineSpanFixer.php>`_
  56. - Test class: `PhpCsFixer\\Tests\\Fixer\\Phpdoc\\PhpdocLineSpanFixerTest <./../../../tests/Fixer/Phpdoc/PhpdocLineSpanFixerTest.php>`_
  57. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.