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

PHPCSStandards / PHP_CodeSniffer / 13467058181
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: catch-per-3.0
DEFAULT BRANCH: master
Ran 21 Feb 2025 11:36PM UTC
Jobs 8
Files 262
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

21 Feb 2025 11:34PM UTC coverage: 77.331% (+0.02%) from 77.315%
13467058181

push

github

jrfnl
Squiz/MemberVarSpacing: bug fix / improve parse error handling

The `Squiz.WhiteSpace.MemberVarSpacing` sniff checks the number of blank lines before a property declaration.

To determine the number of blank lines before a property, it tries to find the start of the statement by:
* First finding the first modifier keyword before the variable (to skip over a potential type declaration);
* And then walking over the other modifiers until it finds the first one for the statement;
* After that, it checks for potential docblocks and attributes and skips over those.

Only after all that it checks the number of blank lines.

The first step however leads to problems when, during live coding, a property would be declared without a modifier keyword.
In that case, the sniff could walk back much further than it should, potentially misidentifying a modifier keyword for a function for the modifier keyword for the property.

While this is an edge-case as it is not customary for properties to be declared _after_ functions, the sniff should still handle this situation correctly.

Fixed by changing the logic of the sniff to stop searching earlier.

Includes new test case files, both of which demonstrate the bug.
Additionally, the test in the `1` file safeguards that the current behaviour of the sniff for multi-property declarations is not aversely affected by the fix.

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

19178 of 24800 relevant lines covered (77.33%)

76.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 os-ubuntu-latest-php-8.4-custom-ini-false - 13467058181.1 21 Feb 2025 11:40PM UTC 262
75.83
GitHub Action Run
2 cbf-os-ubuntu-latest-ubuntu-latest-php-8.1-custom-ini-true - 13467058181.2 21 Feb 2025 11:40PM UTC 262
1.9
GitHub Action Run
3 os-windows-latest-php-8.4-custom-ini-false - 13467058181.3 21 Feb 2025 11:37PM UTC 262
2.68
GitHub Action Run
4 os-ubuntu-latest-php-7.2-custom-ini-false - 13467058181.4 21 Feb 2025 11:41PM UTC 262
73.66
GitHub Action Run
5 cbf-os-ubuntu-latest-ubuntu-latest-php-7.2-custom-ini-false - 13467058181.5 21 Feb 2025 11:41PM UTC 262
0.81
GitHub Action Run
6 os-windows-latest-php-7.2-custom-ini-false - 13467058181.6 21 Feb 2025 11:36PM UTC 262
2.13
GitHub Action Run
7 cbf-os-ubuntu-latest-ubuntu-latest-php-8.4-custom-ini-false - 13467058181.7 21 Feb 2025 11:40PM UTC 262
1.89
GitHub Action Run
8 os-ubuntu-latest-php-8.1-custom-ini-true - 13467058181.8 21 Feb 2025 11:40PM UTC 262
75.85
GitHub Action Run
Source Files on build 13467058181
  • Tree
  • List 262
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #13467058181
  • f3df7282 on github
  • Prev Build on 4.0 (#13451371684)
  • Next Build on 4.0 (#13467079675)
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