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

PHPCSStandards / PHP_CodeSniffer / 10240520713 / 1
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: master
Ran 05 Aug 2024 12:35AM UTC
Files 260
Run time 6s
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: 72.426% (+0.002%) from 72.424%
10240520713.1

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

17525 of 24197 relevant lines covered (72.43%)

23.95 hits per line

Source Files on job php-8.1-custom-ini-true - 10240520713.1
  • Tree
  • List 0
  • Changed 2
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 10240520713
  • 5fe7d741 on github
  • Prev Job for on 4.0 (#10206368215.2)
  • Next Job for on 4.0 (#10322894362.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