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

keradus / PHP-CS-Fixer / 2808
94%
1.11: 82%

Build:
Build:
LAST BUILD BRANCH: master
DEFAULT BRANCH: 1.11
Ran 22 May 2017 10:19PM UTC
Jobs 1
Files 274
Run time 14s
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
2808

push

travis-ci

keradus
feature #2740 Add VoidReturnFixer (mrmark)

This PR was squashed before being merged into the 2.4-dev branch (closes #2740).

Discussion
----------

Add VoidReturnFixer

Hello, first time contributor here!

This fixer adds the PHP7.1 void return type on functions that have no return statements or all the return statements are empty.

For reviewers, I'd like to call out the following:
* Please ensure `getDefinition` looks right.
* `applyFix` could likely be optimized by not using a `foreach` and instead jumping over function body definitions when a function is skipped.  Let me know if this should be done.
* In `fixFunctionDefinition`, I'm unsure if `new Token([T_STRING, 'void']),` is correct.

I ran this fixer on one of my personal projects and it worked well, except that it applies the fix to methods that implement interfaces, abstract classes, etc that belong to 3rd party vendors.  This doesn't seem to break tests, but also doesn't seem 100% correct.  Unsure if there is a better way to fix this or because it's not 100% correct, then this fixer shouldn't be included.  Maybe this is a fixer that you just run occasionally instead of all the time?  Anyways, feedback on this is welcome.

Cheers and thanks!

Commits
-------

505459d Add VoidReturnFixer

6793 of 9009 relevant lines covered (75.4%)

24.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2808.1 (DEPLOY=yes TASK_TESTS_COVERAGE=1) 22 May 2017 10:13PM UTC 0
75.4
Travis Job 2808.1
Source Files on build 2808
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2808
  • 1aae92d3 on github
  • Prev Build on master (#2789)
  • Next Build on master (#2869)
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