declare_parentheses.rst 942 B

12345678910111213141516171819202122232425262728293031323334
  1. ============================
  2. Rule ``declare_parentheses``
  3. ============================
  4. There must not be spaces around ``declare`` statement parentheses.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. -<?php declare ( strict_types=1 );
  13. +<?php declare(strict_types=1);
  14. Rule sets
  15. ---------
  16. The rule is part of the following rule sets:
  17. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  18. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  19. References
  20. ----------
  21. - Fixer class: `PhpCsFixer\\Fixer\\LanguageConstruct\\DeclareParenthesesFixer <./../../../src/Fixer/LanguageConstruct/DeclareParenthesesFixer.php>`_
  22. - Test class: `PhpCsFixer\\Tests\\Fixer\\LanguageConstruct\\DeclareParenthesesFixerTest <./../../../tests/Fixer/LanguageConstruct/DeclareParenthesesFixerTest.php>`_
  23. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.