class_keyword_remove.rst 939 B

1234567891011121314151617181920212223242526272829303132333435
  1. =============================
  2. Rule ``class_keyword_remove``
  3. =============================
  4. Converts ``::class`` keywords to FQCN strings.
  5. Warning
  6. -------
  7. This rule is deprecated and will be removed in the next major version
  8. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9. Examples
  10. --------
  11. Example #1
  12. ~~~~~~~~~~
  13. .. code-block:: diff
  14. --- Original
  15. +++ New
  16. <?php
  17. use Foo\Bar\Baz;
  18. -$className = Baz::class;
  19. +$className = 'Foo\Bar\Baz';
  20. References
  21. ----------
  22. - Fixer class: `PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordRemoveFixer <./../../../src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php>`_
  23. - Test class: `PhpCsFixer\\Tests\\Fixer\\LanguageConstruct\\ClassKeywordRemoveFixerTest <./../../../tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php>`_
  24. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.