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

PHPCSStandards / PHP_CodeSniffer / 10375015156
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: PSR2-WrongOpenercase-with-colon-and-bracket-is-unclear
DEFAULT BRANCH: master
Ran 13 Aug 2024 06:18PM 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

13 Aug 2024 06:14PM UTC coverage: 73.853% (+0.003%) from 73.85%
10375015156

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.

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

17992 of 24362 relevant lines covered (73.85%)

71.16 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-7.2-custom-ini-false - 10375015156.1 13 Aug 2024 06:21PM UTC 260
69.8
GitHub Action Run
2 php-8.1-custom-ini-true - 10375015156.2 13 Aug 2024 06:18PM UTC 260
72.43
GitHub Action Run
3 php-8.3-custom-ini-false - 10375015156.3 13 Aug 2024 06:19PM UTC 260
72.4
GitHub Action Run
Source Files on build 10375015156
  • 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 #10375015156
  • 0f69726d on github
  • Prev Build on 4.0 (#10322894362)
  • Next Build on 4.0 (#10375273139)
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