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

PHPCSStandards / PHP_CodeSniffer / 10205403704
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: catch-per-3.0
DEFAULT BRANCH: master
Ran 01 Aug 2024 08:40PM UTC
Jobs 3
Files 260
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

01 Aug 2024 08:35PM UTC coverage: 74.653% (-0.007%) from 74.66%
10205403704

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.

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

17981 of 24086 relevant lines covered (74.65%)

71.9 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
0.0
0.0% src/Sniffs/AbstractPatternSniff.php
Jobs
ID Job ID Ran Files Coverage
1 php-7.2-custom-ini-false - 10205403704.1 01 Aug 2024 08:42PM UTC 260
70.55
GitHub Action Run
2 php-8.1-custom-ini-true - 10205403704.2 01 Aug 2024 08:40PM UTC 260
72.41
GitHub Action Run
3 php-8.3-custom-ini-false - 10205403704.3 01 Aug 2024 08:40PM UTC 260
72.37
GitHub Action Run
Source Files on build 10205403704
  • Tree
  • List 260
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #10205403704
  • 2968ce07 on github
  • Prev Build on 4.0 (#10174212554)
  • Next Build on 4.0 (#10205858446)
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