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

FriendsOfPHP / PHP-CS-Fixer / 20648
93%

Build:
DEFAULT BRANCH: master
Ran 10 Apr 2020 04:54PM UTC
Jobs 1
Files 408
Run time 1min
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
20648

push

travis-ci

keradus
feature #4778 UseArrowFunctionsFixer - introduction (gharlan)

This PR was merged into the 2.17-dev branch.

Discussion
----------

UseArrowFunctionsFixer - introduction

```php
$array = array_map(function (Foo $foo) use ($x) {
    return $foo->bar($x);
}, $array);
```

is fixed to:

```php
$array = array_map(fn (Foo $foo) => $foo->bar($x), $array);
```

---

But only real one-liner return statements are transformed. If there is a comment before, or if the return statement uses more lines, there is no point in using an arrow function.
So these cases are not transformed:

```php
foo(function () {
    // explanation for the return statement
    return 1;
});

foo(function () {
    return bar(
       $a,
       $b
    );
});
```

Commits
-------

9e7a55801 UseArrowFunctionsFixer - introduction

14783 of 17934 relevant lines covered (82.43%)

33.93 hits per line

Jobs
ID Job ID Ran Files Coverage
7 20648.7 (DEFAULT_COMPOSER_FLAGS="--optimize-autoloader --no-interaction --no-progress" COMPOSER_FLAGS="") 10 Apr 2020 04:53PM UTC 0
82.43
Travis Job 20648.7
Source Files on build 20648
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #20648
  • bd9771e6 on github
  • Prev Build on master (#20637)
  • Next Build on master (#20655)
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