no_leading_import_slash.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ================================
  2. Rule ``no_leading_import_slash``
  3. ================================
  4. Remove leading slashes in ``use`` clauses.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. namespace Foo;
  14. -use \Bar;
  15. +use Bar;
  16. Rule sets
  17. ---------
  18. The rule is part of the following rule sets:
  19. - `@PER <./../../ruleSets/PER.rst>`_
  20. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  21. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  22. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  23. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  24. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  25. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  26. References
  27. ----------
  28. - Fixer class: `PhpCsFixer\\Fixer\\Import\\NoLeadingImportSlashFixer <./../../../src/Fixer/Import/NoLeadingImportSlashFixer.php>`_
  29. - Test class: `PhpCsFixer\\Tests\\Fixer\\Import\\NoLeadingImportSlashFixerTest <./../../../tests/Fixer/Import/NoLeadingImportSlashFixerTest.php>`_
  30. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.