apache / apache/netbeans

[PHP] Relaxing constant hint rule for enum

Open
#5,096 0 comments 0 reactions 0 assignees View on GitHub
kind:feature PHP
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

Enum are conceptually expansion of class with constant. Since PHP enum can have constant, and enum case name witten in StudlyCaps are common practice, it is necessary to adjust the writing style of enum constant like enum case.

At the moment, forcing class constant to be all uppercase is considered too strict for enum use case. We need a little relaxing rule for enum. There are options for this issue:
- implicitly ignoring the rule just for enum and fallback to StudlyCaps
- add new option which can be applied by user manually

### Use case/motivation

```php

Contributor guide

Open the contributing guide

Research direction

No implementation file or test is identified in the issue. First locate the PHP naming rule that enforces uppercase class constants and determine whether enum constants should be exempted or supported through a user option; done means the selected behavior is implemented and covered by the relevant rule tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.