• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FriendsOfPHP / PHP-CS-Fixer / 18483
93%

Build:
DEFAULT BRANCH: master
Ran 05 Aug 2019 10:03PM UTC
Jobs 1
Files 385
Run time 54s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
18483

cron

travis-ci

SpacePossum
feature #4358 SelfStaticAccessorFixer - Introduction (SpacePossum)

This PR was merged into the 2.16-dev branch.

Discussion
----------

SelfStaticAccessorFixer - Introduction

```
$ php php-cs-fixer describe self_static_accessor
Description of self_static_accessor rule.
Inside a final class or anonymous class `self::X` should be preferred to `static::X`.

Fixing examples:
 * Example #1.
   ---------- begin diff ----------
   --- Original
   +++ New
   @@ -1,15 +1,15 @@
    <?php
    final class Sample
    {
        private static $A = 1;

        public function getBar()
        {
   -        return static::class.static::test().static::$A;
   +        return self::class.self::test().self::$A;
        }

        private static function test()
        {
            return 'test';
        }
    }

   ----------- end diff -----------

 * Example #2.
   ---------- begin diff ----------
   --- Original
   +++ New
   @@ -1,7 +1,7 @@
    <?php
    $a = new class() {
        public function getBar()
        {
   -        return static::class;
   +        return self::class;
        }
    };

   ----------- end diff -----------
```
following:
- https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/3900#issuecomment-404857159
- https://github.com/symfony/symfony/pull/27860

Commits
-------

1a2a83a5 Add SelfStaticAccessorFixer

14614 of 15869 relevant lines covered (92.09%)

63.18 hits per line

Jobs
ID Job ID Ran Files Coverage
7 18483.7 (COLLECT_COVERAGE=1) 05 Aug 2019 10:01PM UTC 0
92.09
Travis Job 18483.7
Source Files on build 18483
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #18483
  • 24491e70 on github
  • Prev Build on master (#18480)
  • Next Build on master (#18558)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc