heredoc_to_nowdoc.rst 844 B

1234567891011121314151617181920212223242526272829303132333435
  1. ==========================
  2. Rule ``heredoc_to_nowdoc``
  3. ==========================
  4. Convert ``heredoc`` to ``nowdoc`` where possible.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. -<?php $a = <<<"TEST"
  13. +<?php $a = <<<'TEST'
  14. Foo
  15. TEST;
  16. Rule sets
  17. ---------
  18. The rule is part of the following rule set:
  19. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  20. References
  21. ----------
  22. - Fixer class: `PhpCsFixer\\Fixer\\StringNotation\\HeredocToNowdocFixer <./../../../src/Fixer/StringNotation/HeredocToNowdocFixer.php>`_
  23. - Test class: `PhpCsFixer\\Tests\\Fixer\\StringNotation\\HeredocToNowdocFixerTest <./../../../tests/Fixer/StringNotation/HeredocToNowdocFixerTest.php>`_
  24. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.