FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow enum suffix omission when in Enum namespace by dereuromark · Pull Request #428 · cakephp/cakephp-codesniffer · GitHub

Allow enum suffix omission when in Enum namespace - #428

Merged
LordSimal merged 1 commit into
6.xfrom
relax-enum-suffix-in-enum-namespace
Mar 14, 2026
Merged

Allow enum suffix omission when in Enum namespace#428
LordSimal merged 1 commit into
6.xfrom
relax-enum-suffix-in-enum-namespace

Conversation

Copy link
Copy Markdown
Member

Summary

  • Allow omitting the "Enum" suffix when the enum is in a namespace containing "Enum" as a segment

This avoids redundant naming like:

  • App\Model\Enum\FooBarEnum → can now be App\Model\Enum\FooBar

Both are still valid:

  • App\Model\Enum\Status ✓ (in Enum namespace)
  • App\Model\Enum\StatusEnum ✓ (explicit suffix)
  • App\Model\StatusEnum ✓ (has suffix)
  • App\Model\Status ✗ (neither in Enum namespace nor has suffix)

Refs #425
Refs cakephp/cakephp#19329 (comment)

Relax the ValidEnumNameSniff to allow omitting the "Enum" suffix when
the enum is in a namespace containing "Enum" as a segment (e.g.,
`App\Model\Enum\Status` is now valid without the suffix).

This avoids redundant naming like `App\Model\Enum\FooBarEnum`.

Refs #425
LordSimal merged commit 1950643 into 6.x Mar 14, 2026
6 checks passed
LordSimal deleted the relax-enum-suffix-in-enum-namespace branch March 14, 2026 13:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL