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

PHPCSStandards / PHP_CodeSniffer / 11206909767
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: master
Ran 07 Oct 2024 01:19AM UTC
Jobs 3
Files 261
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

07 Oct 2024 01:14AM UTC coverage: 73.921% (-0.009%) from 73.93%
11206909767

push

github

jrfnl
Runner::processFile()/error handling: add more defensive coding

Follow up to squizlabs/PHP_CodeSniffer 3716 and PR 524.

PR squizlabs/PHP_CodeSniffer 3716 improved the information provided in the error messages for `Internal.Exception`s with additional information about the source of the problem.
This code uses the `Common::getSniffCode()` method to transform a sniff class name into a sniff code.

PR 524 changes how the `Common::getSniffCode()` method handles invalid input, i.e. it will now throw an exception when a class is passed which isn't a sniff (or sniff test).

In the context of this error handling, however, this new exception can easily be encountered when an `Abstract...Sniff` class contains the code which triggered the error - which would trigger the exception as it is not a sniff class.

This commit now adds some additional defensive coding to ensure that a) the error message will still be informative, while b) making sure that any exception which may be thrown by the  `Common::getSniffCode()` method will be caught and and won't cause an uncaught `InvalidArgumentException` in the error handling code to stop execution of the script.

Includes a test documenting the behaviour of the `Common::getSniffCode()` method for abstract sniff classes.

0 of 8 new or added lines in 1 file covered. (0.0%)

1 existing line in 1 file now uncovered.

18039 of 24403 relevant lines covered (73.92%)

71.06 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-7.2-custom-ini-false - 11206909767.1 07 Oct 2024 01:20AM UTC 0
69.87
GitHub Action Run
2 php-8.1-custom-ini-true - 11206909767.2 07 Oct 2024 01:19AM UTC 0
72.5
GitHub Action Run
3 php-8.3-custom-ini-false - 11206909767.3 07 Oct 2024 01:19AM UTC 0
72.47
GitHub Action Run
Source Files on build 11206909767
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #11206909767
  • 31874f89 on github
  • Prev Build on 4.0 (#11167986842)
  • Next Build on 4.0 (#11210094951)
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