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

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

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: master
Ran 13 Aug 2024 06:22PM UTC
Files 260
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

13 Aug 2024 06:14PM UTC coverage: 69.804% (+0.004%) from 69.8%
10375015156.1

push

github

jrfnl
Squiz/EmbeddedPhp: fix false positive when handling short open tags

The content of a PHP long open tag token is `<?php ` (note
the space after the tag). The content of a PHP short open tag is
`<?` (no space after the tag). The sniff did not account correctly for
this difference when checking the expected number of spaces after a
short open tag, resulting in false positives and incorrect fixes.

For example, the code below:

```
<? echo 'one space after short open tag'; ?>
```

Resulted in the error (there is just one space after the opening tag and
not two, as stated in the error):

```
Expected 1 space after opening PHP tag; 2 found (Squiz.PHP.EmbeddedPhp.SpacingAfterOpen)
```

And the incorrect fix:

```
<?echo 'without space after short open tag'; ?>
```

This commit fixes this problem by changing the sniff code to consider
that only long open tags contain a space after the tag in the `content`
key of the token array.

16963 of 24301 relevant lines covered (69.8%)

23.78 hits per line

Source Files on job php-7.2-custom-ini-false - 10375015156.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 10375015156
  • 0f69726d on github
  • Prev Job for on 4.0 (#10322894362.1)
  • Next Job for on 4.0 (#10375273139.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