vscode-phpfmt
vscode-phpfmt copied to clipboard
Constant names incorrectly reformatted to lowercase when named after keyword
Hey!
I've noticed some incorrect lowercasing when constant names match certain PHP keywords. The casing-changes keep accidentally slipping into my commits and it's driving me crazy! I couldn't find a supported way to disable this 'rule' (not sure if it is even a rule) so I figured I'd raise an issue since a const shouldn't really be renamed by a formatter!
To see this, run phpfmt on a class with constants whose names match keywords, for example, print or list in uppercase:
abstract class MyConstants
{
const EXAMPLE = 'example';
const LIST = 'list';
const PRINT = 'print';
const TESTING = 'testing';
const ECHO = 'echo';
}
The const names get changed upon formatting:
abstract class MyConstants
{
const EXAMPLE = 'example';
const list = 'list'; // <<<
const print = 'print'; // <<<
const TESTING = 'testing';
const echo = 'echo'; // <<<
}
Is there some way to disable this?
Thanks for the great formatter!