include.rst 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ================
  2. Rule ``include``
  3. ================
  4. Include/Require and file path should be divided with a single space. File path
  5. should not be placed within parentheses.
  6. Examples
  7. --------
  8. Example #1
  9. ~~~~~~~~~~
  10. .. code-block:: diff
  11. --- Original
  12. +++ New
  13. <?php
  14. -require ("sample1.php");
  15. -require_once "sample2.php";
  16. -include "sample3.php";
  17. -include_once("sample4.php");
  18. +require "sample1.php";
  19. +require_once "sample2.php";
  20. +include "sample3.php";
  21. +include_once "sample4.php";
  22. Rule sets
  23. ---------
  24. The rule is part of the following rule sets:
  25. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  26. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  27. References
  28. ----------
  29. - Fixer class: `PhpCsFixer\\Fixer\\ControlStructure\\IncludeFixer <./../../../src/Fixer/ControlStructure/IncludeFixer.php>`_
  30. - Test class: `PhpCsFixer\\Tests\\Fixer\\ControlStructure\\IncludeFixerTest <./../../../tests/Fixer/ControlStructure/IncludeFixerTest.php>`_
  31. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.