
Rule lowercase_static_reference
ΒΆ
Class static references self
, static
and parent
MUST be in lower
case.
ExamplesΒΆ
Example #1ΒΆ
--- 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ΒΆ
--- Original
+++ New
<?php
class Foo extends Bar
{
- public function baz(?self $x) : SELF
+ public function baz(?self $x) : self
{
return false;
}
}
Rule setsΒΆ
The rule is part of the following rule sets: