prettier / prettier/plugin-php
Forcing short hand arrays in PHP
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.9k
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Description
It appears the PHP array short hand is being forced for version 5.4 and above?
const useShortForm =
(node.kind === "array" && isMinVersion(options.phpVersion, "5.4")) ||
(node.kind === "list" && node.shortForm
Can this be updated to have the option to override this?
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 from the useShortForm expression shown in the issue and trace how formatter options are read for PHP arrays. Define how an override should interact with the PHP version check, then verify that formatting can preserve the requested array form without changing the existing default behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100