format/classes/modifier-keywords
In the format-laravel and format-psr12 presets. Safe fix.
What it does
Classes, constants, properties, and methods MUST have visibility declared, and keyword modifiers MUST be in the following order: inheritance modifier (abstract or final), visibility modifier (public, protected, or private), set-visibility modifier (public(set), protected(set), or private(set)), scope modifier (static), mutation modifier (readonly), type declaration, name.
Configuration
[format.rules]
"classes/modifier-keywords" = true
To skip it in some files, add a @pun-ignore-file comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
elements |
list |
const, method, property |
["const", "method", "property"] |
elements |
Replaces
modifier_keywords(php-cs-fixer)VarToPublicProperty(rector)