prettier / prettier/plugin-php
Case build-in classes
Open
Nobody has claimed this yet.
discussion
enhancement
needs investigation
- Dominant language
- PHP
- Stars
- 1.9k
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Description
Ref: http://php.net/manual/en/reserved.classes.php
In php allowed use any case of build-in class:
$exception = new Exception('Message');
$exception = new EXCEPTION('Message');
$exception = new eXcEpTiOn('Message');
Always return exception build-in class.
Should we prettify class names? Also don't forget about namespaces.
- File without namespace -
new Exception()===new \Exception();. - File with namespace -
new Exception!==new \Exception.
In theory we can do it:
- If namespace exists only correct
new \Exception(); - If namespace doesn't exists correct and
new Exception()andnew \Exception();
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 issue's PHP examples and the reserved-class and namespace rules it references. Done requires an agreed, namespace-aware decision for handling built-in class names in both namespaced and non-namespaced files, followed by implementation and coverage in the relevant formatter 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
- 35/100