no_homoglyph_names.rst 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ===========================
  2. Rule ``no_homoglyph_names``
  3. ===========================
  4. Replace accidental usage of homoglyphs (non ascii characters) in names.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Renames classes and cannot rename the files. You might have string references to
  10. renamed code (``$$name``).
  11. Examples
  12. --------
  13. Example #1
  14. ~~~~~~~~~~
  15. .. code-block:: diff
  16. --- Original
  17. +++ New
  18. -<?php $nаmе = 'wrong "a" character';
  19. +<?php $name = 'wrong "a" character';
  20. Rule sets
  21. ---------
  22. The rule is part of the following rule sets:
  23. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  24. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_
  25. References
  26. ----------
  27. - Fixer class: `PhpCsFixer\\Fixer\\Naming\\NoHomoglyphNamesFixer <./../../../src/Fixer/Naming/NoHomoglyphNamesFixer.php>`_
  28. - Test class: `PhpCsFixer\\Tests\\Fixer\\Naming\\NoHomoglyphNamesFixerTest <./../../../tests/Fixer/Naming/NoHomoglyphNamesFixerTest.php>`_
  29. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.