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

PHPCSStandards / PHP_CodeSniffer / 7657699139
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: PSR2-WrongOpenercase-with-colon-and-bracket-is-unclear
DEFAULT BRANCH: master
Ran 25 Jan 2024 04:45PM UTC
Jobs 3
Files 258
Run time 40s
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

25 Jan 2024 04:44PM UTC coverage: 65.342% (+0.002%) from 65.34%
7657699139

push

github

jrfnl
Generic/ArbitraryParenthesesSpacing: improve handling of switch-case scope closers

Follow up on squizlabs/PHP_CodeSniffer 2826 which was fixed via squizlabs/PHP_CodeSniffer 2876.

The sniff explicitly only intends to handle _arbitrary_ parentheses and tries to avoid clashes with sniffs handling the parentheses spacing of function calls and language construct invocations.

This is done by the sniff bowing out early when the token before the open parenthesis is a token which can be used in a (variable) function call or one of a select list of reserved keywords.

The previous PR tweaked the "bowing out" to allow the sniff to operate on arbitrary parentheses which directly follow the close curly brace of a a previous scope.

The additional condition added was, however, not limited to `T_CLOSE_CURLY_BRACKET` tokens.

This has led to a new false positive: When a `die()`/`exit()` is used within a `switch-case` statement, the `die`/`exit` keyword will be regarded as a scope closer for the `case` statement, in which case, the parentheses for the `die`/`exit` would now be treated as arbitrary instead of as belonging to the `die`/`exit` keyword.

This commit fixes this by limiting the previously introduced check for a scope closer to curly braces only.

Includes tests proving the bug and safeguarding the fix.

15533 of 23772 relevant lines covered (65.34%)

6.69 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-7.2-custom-ini-false - 7657699139.1 25 Jan 2024 04:45PM UTC 0
61.77
GitHub Action Run
2 php-8.3-custom-ini-false - 7657699139.2 25 Jan 2024 04:45PM UTC 0
64.45
GitHub Action Run
3 php-8.1-custom-ini-true - 7657699139.3 25 Jan 2024 04:45PM UTC 0
64.4
GitHub Action Run
Source Files on build 7657699139
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #7657699139
  • d55deffb on github
  • Prev Build on 4.0 (#7657542703)
  • Next Build on 4.0 (#7661383819)
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