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

PHPCSStandards / PHP_CodeSniffer / 10205403704 / 2
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: catch-per-3.0
DEFAULT BRANCH: master
Ran 01 Aug 2024 08:42PM UTC
Files 260
Run time 9s
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

01 Aug 2024 08:35PM UTC coverage: 72.405% (-0.006%) from 72.411%
10205403704.2

push

github

jrfnl
AbstractPatternSniff: prevent PHP notice

In a live coding situation, the token triggering the pattern being looked for could be at or near the end of the file.
This could lead to a situation where the pattern could never match anyhow as there are not enough tokens left in the file to match against.

In this situation, the sniff could trigger the following PHP error:
```
Increment on type bool has no effect, this will change in the next major version of PHP in path/to/phpcs/src/Sniffs/AbstractPatternSniff.php on line 627
```

This commit prevents this error by bowing out early if there are not enough tokens in the file under scan to match the pattern.

Tested via the `Squiz.Functions.FunctionDeclaration` sniff via which this issue was discovered.

17517 of 24193 relevant lines covered (72.41%)

23.93 hits per line

Source Files on job php-8.1-custom-ini-true - 10205403704.2
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 10205403704
  • 2968ce07 on github
  • Prev Job for on 4.0 (#10174212554.2)
  • Next Job for on 4.0 (#10205858446.2)
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