benmatselby / sublime-phpcs

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

Php-cs-fixer not working in Sublime Text 3. #113

Closed anhskohbo closed 10 years ago

anhskohbo commented 10 years ago

I can't make phpcs-fixer working:

Right click menu, PHP CS -> Fix this file, nothing happens.

screenshot from 2014-06-29 20 01 12

Run from terminal, it's working:

/usr/local/bin/php-cs-fixer fix /home/anhskohbo/htdocs/laravel/app/controllers/AuthController.php --verbose --level=all

php-cs-fixer path: screenshot from 2014-06-29 20 04 02

My config file:

{
    // Plugin settings
    "show_debug": true,
    "phpcs_show_quick_panel": false,

    // PHP_CodeSniffer settings
    "phpcs_sniffer_run": true,
    "phpcs_executable_path": "/opt/lampp/bin/phpcs",
    "phpcs_additional_args": {
        "--standard": "PSR2",
        "-n": ""
    },

    // PHP-CS-Fixer settings
    "php_cs_fixer_on_save": false,
    "php_cs_fixer_executable_path": "/usr/local/bin/php-cs-fixer",
    "php_cs_fixer_additional_args": {
        "--level": "all"
    },

    // PHP Linter settings
    "phpcs_linter_run": true,
    "phpcs_php_path": "/opt/lampp/bin/php",

    // PHP Mess Detector settings
    "phpmd_run": false,
    "phpmd_executable_path": "/opt/lampp/bin/phpmd"
}
benmatselby commented 10 years ago

When you say "nothing happens", nothing will happen unless there is something to fix, that the php-cs-fixer application can fix.

What is the output from the command line? Copy the command from ST console window into a terminal and does the output match?

benmatselby commented 10 years ago

This has now been resolved by @Archane07. I'm unable to test on Windows, so if people report that this fix breaks windows I will revert the patch as there are more windows users than Linux/Mac.