Rule class_keyword_remove
¶
Converts ::class
keywords to FQCN strings.
Warning¶
This rule is deprecated and will be removed in the next major version¶
Examples¶
Example #1¶
--- Original
+++ New
<?php
use Foo\Bar\Baz;
-$className = Baz::class;
+$className = 'Foo\Bar\Baz';
References¶
Fixer class: PhpCsFixer\Fixer\LanguageConstruct\ClassKeywordRemoveFixer
Test class: PhpCsFixer\Tests\Fixer\LanguageConstruct\ClassKeywordRemoveFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.