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

PHPCSStandards / PHP_CodeSniffer / 10240520713
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: master
Ran 05 Aug 2024 12:34AM 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

05 Aug 2024 12:29AM UTC coverage: 73.85% (-0.8%) from 74.672%
10240520713

push

github

jrfnl
Tokenizer: apply tab replacement to heredoc/nowdoc opener

_You learn something new every day ;-)_

While probably exceedingly rare to be found in actual codebases, the PHP tokenizer apparently allows for whitespace between the `<<<` and the heredoc/nowdoc identifier. See: https://3v4l.org/NUHZd

Both spaces as well as tabs are allowed. New lines are not allowed. Comments are also not allowed. See: https://3v4l.org/7PIEK

The PHPCS `Tokenizer` did not execute tab replacement on these tokens leading to unexpected `'content'` and incorrect `'length'` values in the `File::$tokens` array, which in turn could lead to incorrect sniff results and incorrect fixes.

This commit adds the `T_START_HEREDOC`/`T_START_NOWDOC` tokens to the array of tokens for which to do tab replacement to make them more consistent with the rest of PHPCS.

Includes unit tests safeguarding this change.

Ref: https://externals.io/message/124462#124518

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

269 existing lines in 7 files now uncovered.

17989 of 24359 relevant lines covered (73.85%)

71.17 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-8.1-custom-ini-true - 10240520713.1 05 Aug 2024 12:34AM UTC 0
72.43
GitHub Action Run
2 php-7.2-custom-ini-false - 10240520713.2 05 Aug 2024 12:35AM UTC 0
69.8
GitHub Action Run
3 php-8.3-custom-ini-false - 10240520713.3 05 Aug 2024 12:34AM UTC 0
72.39
GitHub Action Run
Source Files on build 10240520713
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #10240520713
  • 5fe7d741 on github
  • Prev Build on 4.0 (#10206368215)
  • Next Build on 4.0 (#10322894362)
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