psr4.rst 679 B

12345678910111213141516171819202122232425262728293031323334353637
  1. =============
  2. Rule ``psr4``
  3. =============
  4. Class names should match the file name.
  5. .. warning:: Using this rule is risky.
  6. This fixer may change your class name, which will break the code that depends
  7. on the old name.
  8. Examples
  9. --------
  10. Example #1
  11. ~~~~~~~~~~
  12. .. code-block:: diff
  13. --- Original
  14. +++ New
  15. @@ -1,3 +1,3 @@
  16. <?php
  17. namespace PhpCsFixer\FIXER\Basic;
  18. -class InvalidName {}
  19. +class Psr4Fixer {}
  20. Rule sets
  21. ---------
  22. The rule is part of the following rule sets:
  23. @Symfony:risky
  24. Using the ``@Symfony:risky`` rule set will enable the ``psr4`` rule.
  25. @PhpCsFixer:risky
  26. Using the ``@PhpCsFixer:risky`` rule set will enable the ``psr4`` rule.