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

FriendsOfPHP / PHP-CS-Fixer / 11291
82%
master: 93%

Build:
Build:
LAST BUILD BRANCH: phpdocAlignFixer
DEFAULT BRANCH: master
Ran 01 Aug 2017 12:11PM UTC
Jobs 1
Files 269
Run time 10s
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
11291

push

travis-ci

keradus
bug #2939 NoUnusedImportsFixer - Fix extra blank line (julienfalque)

This PR was merged into the 2.2 branch.

Discussion
----------

NoUnusedImportsFixer - Fix extra blank line

Fixes an edge case bug with `no_unused_imports` fixer: when removing several consecutive `use` statements, some because they are not used **and** some because they are superfluous (same namespace), the fixer leaves an extra blank line, which then isn't removed by `no_extra_consecutive_blank_lines` fixer. If you run the tool again, the extra line is correctly removed by `no_extra_consecutive_blank_lines`.

Here is the result of one of the tests I added, before the fix:
```diff
 <?php

 namespace Foo;

-use Foo\A;
-use Foo\Bar\B;
+
 use Foo\Bar\C;

 abstract class D extends A implements C
 {
 }
```

I first thought this was a priority issue, but the fixers already run in the correct order (and this is covered by an integration test).

But the issue is that when removing a token, it is actually replaced with an empty one, so you might end up with whitespace tokens being separated by several empty tokens, even when using `Tokens::clearTokenAndMergeSurroundingWhitespace()`. This must be taken into consideration when dealing with whitespaces.

Commits
-------

8566fd53 Fix extra blank line

7123 of 9166 relevant lines covered (77.71%)

25.15 hits per line

Jobs
ID Job ID Ran Files Coverage
1 11291.1 (DEPLOY=yes TASK_TESTS_COVERAGE=1) 01 Aug 2017 12:03PM UTC 0
77.71
Travis Job 11291.1
Source Files on build 11291
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #11291
  • 0e7f49b9 on github
  • Prev Build on 2.2 (#11254)
  • Next Build on 2.2
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