doc/rules/casing/lowercase_static_reference.rst
lowercase_static_referenceClass static references self, static and parent MUST be in lower
case.
Example #1
.. code-block:: diff
--- Original
+++ New
<?php
class Foo extends Bar
{
public function baz1()
{
- return STATIC::baz2();
+ return static::baz2();
}
public function baz2($x)
{
- return $x instanceof Self;
+ return $x instanceof self;
}
- public function baz3(PaRent $x)
+ public function baz3(parent $x)
{
return true;
}
}
Example #2
.. code-block:: diff
--- Original +++ New <?php class Foo extends Bar {
The rule is part of the following rule sets:
@PER <./../../ruleSets/PER.rst>_ (deprecated)@PER-CS <./../../ruleSets/PER-CS.rst>_@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>_ (deprecated)@PER-CS1x0 <./../../ruleSets/PER-CS1x0.rst>_@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>_ (deprecated)@PER-CS2x0 <./../../ruleSets/PER-CS2x0.rst>_@PER-CS3.0 <./../../ruleSets/PER-CS3.0.rst>_ (deprecated)@PER-CS3x0 <./../../ruleSets/PER-CS3x0.rst>_@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>_@PSR12 <./../../ruleSets/PSR12.rst>_@Symfony <./../../ruleSets/Symfony.rst>_PhpCsFixer\\Fixer\\Casing\\LowercaseStaticReferenceFixer <./../../../src/Fixer/Casing/LowercaseStaticReferenceFixer.php>_PhpCsFixer\\Tests\\Fixer\\Casing\\LowercaseStaticReferenceFixerTest <./../../../tests/Fixer/Casing/LowercaseStaticReferenceFixerTest.php>_The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.