benmatselby / sublime-phpcs

🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Other
814 stars 126 forks source link

Php-cs-fizer is changing my namespace #135

Closed BenjaminRosell closed 9 years ago

BenjaminRosell commented 9 years ago

Hello there,

Just a quick question... The Cs-Fixer is changing my namespace from

App\Namespace to app\Namespace

Any ideas ?

benmatselby commented 9 years ago

Same as this? https://github.com/benmatselby/sublime-phpcs/issues/133

vluzrmos commented 9 years ago

Your source doesn't follow the PSR-0, it means the path needs to be same of namespace. Then you just need to disable that fixer.

Preferences > Package Settings > PHP Code Sniffer > Settings User:

{
    //...
    "php_cs_fixer_additional_args": {
        "--fixers": "-psr0"
    }
}
jcloutz commented 9 years ago

This is the same issue that I was having in #133. It is an intentional decision by the in laravel to not adhere to the PSR-0 standard for some reason. I ended up just refactoring the namespace but as @vluzrmos said you can also disable the fixer for it.