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

FriendsOfPHP / PHP-CS-Fixer / 2568 / 3
84%
master: 93%

Build:
Build:
LAST BUILD BRANCH: phpdocAlignFixer
DEFAULT BRANCH: master
Ran 10 Feb 2015 08:59PM UTC
Files 97
Run time 5s
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

10 Feb 2015 08:53PM UTC coverage: 80.112% (+0.03%) from 80.08%
2568.3

push

travis-ci

keradus
feature #1002 Add HeaderCommentFixer (ajgarlag)

This PR was squashed before being merged into the 1.5 branch (closes #1002).

Discussion
----------

Add HeaderCommentFixer

In most projects, every php file has a header comment with information about copyright and license. This PR introduces a new fixer to add, rewrite or remove this header comment in order to standarize it. This is a particular fixer, because it needs a configuration parameter, the header text, that varies with the project.

I made a first implementation where a new method `getHeader` was added to `ConfigInterface`, so the fixer implementing the `ConfigAwareInterface` could read the header text, but this new method was BC break.

In my second implementation, the header is statically set into the `HeaderCommentFixer` class so it can be set from the config file without any BC break. If you think there is a better way to accomplish this, ping me.

The fixer only modifies files with `php` extension starting with a `T_OPEN_TAG` token. It will add a header comment, or rewrite the existing one to update the header text. If the header text is empty, it will remove the header comment.

This PR adds the fixer to the `.php_cs` config file for this project. Another PR #1003 has been opened to update the header comments in this project after running this new fixer.

Commits
-------

04c8137 Add HeaderCommentFixer

2864 of 3575 relevant lines covered (80.11%)

48.24 hits per line

Source Files on job 2568.3
  • Tree
  • List 0
  • Changed 14
  • Source Changed 4
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2568
  • Travis Job 2568.3
  • 05601164 on github
  • Prev Job for on 1.5 (#2567.3)
  • Next Job for on 1.5 (#2574.1)
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