declare_equal_normalize.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ================================
  2. Rule ``declare_equal_normalize``
  3. ================================
  4. Equal sign in declare statement should be surrounded by spaces or not following
  5. configuration.
  6. Configuration
  7. -------------
  8. ``space``
  9. ~~~~~~~~~
  10. Spacing to apply around the equal sign.
  11. Allowed values: ``'none'`` and ``'single'``
  12. Default value: ``'none'``
  13. Examples
  14. --------
  15. Example #1
  16. ~~~~~~~~~~
  17. *Default* configuration.
  18. .. code-block:: diff
  19. --- Original
  20. +++ New
  21. <?php
  22. -declare(ticks = 1);
  23. +declare(ticks=1);
  24. Example #2
  25. ~~~~~~~~~~
  26. With configuration: ``['space' => 'single']``.
  27. .. code-block:: diff
  28. --- Original
  29. +++ New
  30. <?php
  31. -declare(ticks=1);
  32. +declare(ticks = 1);
  33. Rule sets
  34. ---------
  35. The rule is part of the following rule sets:
  36. - `@PER <./../../ruleSets/PER.rst>`_
  37. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  38. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  39. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  40. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  41. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  42. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  43. References
  44. ----------
  45. - Fixer class: `PhpCsFixer\\Fixer\\LanguageConstruct\\DeclareEqualNormalizeFixer <./../../../src/Fixer/LanguageConstruct/DeclareEqualNormalizeFixer.php>`_
  46. - Test class: `PhpCsFixer\\Tests\\Fixer\\LanguageConstruct\\DeclareEqualNormalizeFixerTest <./../../../tests/Fixer/LanguageConstruct/DeclareEqualNormalizeFixerTest.php>`_
  47. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.