| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- ===================================
- Rule ``lowercase_static_reference``
- ===================================
- Class static references ``self``, ``static`` and ``parent`` MUST be in lower
- case.
- Examples
- --------
- Example #1
- ~~~~~~~~~~
- .. code-block:: diff
- --- Original
- +++ New
- @@ -3,16 +3,16 @@
- {
- 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
- @@ -1,8 +1,8 @@
- <?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:
- @Symfony
- Using the ``@Symfony`` rule set will enable the ``lowercase_static_reference`` rule.
- @PhpCsFixer
- Using the ``@PhpCsFixer`` rule set will enable the ``lowercase_static_reference`` rule.
|