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

PHPCSStandards / PHP_CodeSniffer / 13467033366 / 6
79%
master: 79%

Build:
DEFAULT BRANCH: master
Ran 22 Feb 2025 12:00AM UTC
Files 309
Run time 10s
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:32PM UTC coverage: 74.023% (+0.02%) from 74.008%
13467033366.6

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.

20397 of 27555 relevant lines covered (74.02%)

25.14 hits per line

Source Files on job os-ubuntu-latest-php-8.4-custom-ini-false - 13467033366.6
  • Tree
  • List 309
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 13467033366
  • 46fbb5dc on github
  • Prev Job for on master (#13451218684.8)
  • Next Job for on master (#13467064726.4)
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