WordPress / WordPress/WordPress-Coding-Standards
Traits and interfaces file name standard
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
Is your feature request related to a problem?
Although we have a standard for class file names, we don't have one for traits or interfaces.
Describe the solution you'd like
For consistency with what we currently require for classes, a trait file name should be prefixed with trait- and an interface file name should be prefixed with interface-.
I'm not a big fan of these prefixes but as we enforce them to classes, it seems to make sense have them for traits and interfaces too.
Issue #1327 mentions the problem but it's almost 2 years old now. As these elements can already be used in core, it would be awesome if these standards are defined before it happens :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing class file-name standard and the related discussion in issue #1327. Define how trait and interface file names should be checked consistently with class names, then verify that the ruleset enforces the trait- and interface- prefixes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100