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

PHPCSStandards / PHPCSExtra / 42270030978
100%

Build:
DEFAULT BRANCH: develop
Ran 06 Nov 2026 06:22PM UTC
Jobs 4
Files 65
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

06 Nov 2026 06:21PM UTC coverage: 99.82% (+0.002%) from 99.818%
42270030978

push

github

web-flow
New `Universal.Enums.CaseName` sniff (#452)

This sniff verifies that enum case names are declared using PascalCase, as required by [PER Coding Style 2.0](https://github.com/php-fig/per-coding-style/blob/2.0.0/spec.md#9-enumerations) ("Enum case declarations MUST use PascalCase capitalization").

The sniff reports two separate errors:

- `NotPascalCase`: the name doesn't start with an uppercase letter or contains characters other than letters and digits (for example, `diamondsRed` or `Diamonds_Red`).
- `HasConsecutiveCaps`: the name contains consecutive uppercase letters. For example, `JsonValue` is accepted while `JSONValue` is not.

Projects that want to allow consecutive uppercase letters can exclude the `HasConsecutiveCaps` error code:

```xml
<rule ref="Universal.Enums.CaseName">
    <exclude name="Universal.Enums.CaseName.HasConsecutiveCaps"/>
</rule>
```

As discussed in php-fig/per-coding-style 161, PER-CS 2.0 accepts consecutive uppercase letters while PER-CS 3.0 doesn't. The separate error-code approach lets this sniff be configured to support both.


### Known limitations

The sniff relies on `PHP_CodeSniffer\Util\Common::isCamelCaps()`, which only recognizes ASCII letters. As a result, enum case names containing non-ASCII characters (for example, `case Café;`) are flagged as not being in PascalCase, even though I believe they should be accepted. This is a pre-existing limitation of `isCamelCaps()` that is shared by all the naming-convention sniffs that depend on it. I searched, and I believe this was not reported before. As discussed in this PR, the sniff can switch to PHPCSUtils utility methods for naming conventions once those are available.

Fixes 444.

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

3873 of 3880 relevant lines covered (99.82%)

3.51 hits per line

Jobs
ID Job ID Ran Files Coverage
1 php-8.6-phpcs-lowest - 42270030978.1 06 Nov 2026 06:22PM UTC 65
97.0
GitHub Action Run
2 php-5.4-phpcs-lowest - 42270030978.2 06 Nov 2026 06:23PM UTC 65
96.21
GitHub Action Run
3 php-7.2-phpcs-stable - 42270030978.3 06 Nov 2026 06:22PM UTC 65
98.58
GitHub Action Run
4 php-8.6-phpcs-stable - 42270030978.4 06 Nov 2026 06:22PM UTC 65
99.15
GitHub Action Run
Source Files on build 42270030978
  • Tree
  • List 65
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #42270030978
  • 8b00bbfb on github
  • Prev Build on develop (#42125638562)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc