user573
user573

Reputation: 33

Sublimetext php-cs-fixer changes namespace to lowercase

While using sublimetext3 in a Laravel project, php-cs-fixer (PHP CS Fixer version 1.12.0) 'fixes' the namespace (App) from Uppercase to lowercase (app). Eg. namespace App\Http\Controllers; to namespace app\Http\Controllers;

This causes a Class not found error.

If anyone has a suggestion, I would be grateful. I am also considering not using php-cs-fixer and using phpcbf instead.

Upvotes: 2

Views: 304

Answers (1)

idleberg
idleberg

Reputation: 12882

You're following a deprecated PHP Standard Recommendation (PSR-0), while Laravel follows PSR-4.

If you want to continue following PSR-0, try adding this to your phpcs.sublime-settings:

"php_cs_fixer_additional_args": {
    "--fixers": "-psr0"
}

You can find the settings in the menu: Preferences > PHP Code Sniffer > Settings - User

Upvotes: 3

Related Questions