Phpcs
🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter and Mess Detector Support for Sublime Text
Details
Installs
- Total 425K
- Win 264K
- Mac 80K
- Linux 81K
Jun 9 | Jun 8 | Jun 7 | Jun 6 | Jun 5 | Jun 4 | Jun 3 | Jun 2 | Jun 1 | May 31 | May 30 | May 29 | May 28 | May 27 | May 26 | May 25 | May 24 | May 23 | May 22 | May 21 | May 20 | May 19 | May 18 | May 17 | May 16 | May 15 | May 14 | May 13 | May 12 | May 11 | May 10 | May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | Apr 29 | Apr 28 | Apr 27 | Apr 26 | Apr 25 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 2 | 18 | 14 | 10 | 10 | 7 | 13 | 13 | 13 | 11 | 7 | 17 | 7 | 8 | 13 | 10 | 12 | 12 | 14 | 16 | 7 | 7 | 15 | 15 | 13 | 8 | 10 | 14 | 15 | 20 | 18 | 19 | 17 | 11 | 17 | 7 | 13 | 16 | 18 | 10 | 9 | 14 | 15 | 15 | 11 | 10 |
Mac | 3 | 5 | 2 | 4 | 3 | 1 | 4 | 5 | 7 | 5 | 3 | 4 | 3 | 0 | 3 | 4 | 3 | 4 | 4 | 4 | 0 | 3 | 4 | 1 | 6 | 3 | 2 | 0 | 3 | 2 | 3 | 2 | 0 | 1 | 1 | 8 | 1 | 1 | 4 | 2 | 5 | 0 | 1 | 2 | 3 | 3 |
Linux | 0 | 2 | 5 | 6 | 3 | 3 | 2 | 4 | 8 | 4 | 1 | 3 | 0 | 2 | 4 | 9 | 5 | 2 | 2 | 2 | 4 | 3 | 3 | 5 | 6 | 5 | 5 | 4 | 4 | 2 | 5 | 5 | 4 | 0 | 5 | 2 | 2 | 7 | 2 | 3 | 5 | 1 | 4 | 3 | 9 | 2 |
Readme
sublime-phpcs
This plugin adds PHP CodeSniffer, PHP Code Beautifier and Fixer, PHP Coding Standards Fixer, the PHP Linter, PHP Mess Detector, Scheck support to Sublime Text.
For more information about this plugin such as features, installation requirements etc, please click here
Configuration
You will need to configure this plugin to work for your setup, please view the options here
FAQ
What do I do when I get “OSError: [Errno 8] Exec format error”?
- This seems to be an issue you may get with regards to wrapper scripts.
- Please make sure that the application/script you are referencing has the correct shebang line, as per GH-79
What do I do when I get “OSError: [Error 2] No such file or directory”?
- Well, first of all you need to check that you have PHP_CodeSniffer, and if being used, the phpmd application.
- If you have these applications installed, then it sounds like those applications are not in your PATH, or cannot be found in your PATH by the Python runtime, so configure “phpcs_php_path”, “phpcs_executable_path”, “phpmd_executable_path” and “php_cs_fixer_executable_path” with the actual paths to those applications
What do I do when I get “OSError: [Errno 13] Permission denied”?
- It sounds like your path settings are incorrect.
- You need to make sure that when you specifiy the path you include the entire path including the application
$ which phpcs
/usr/local/bin/phpcs
- That entire output is the path you need in your configs.
What if I've installed the applications using Homebrew?
If you have installed php-cs-fixer, phpmd or phpcs via homebrew then please make sure that you define the “*_executable_path” option to the .phar application and not the wrapper script that is placed in your bin folder, as this will cause odd behaviour.
What other Key Bindings can I setup?
The following is a list of commands that you can bind to a keyboard shortcut:
- phpcs_fix_this_file
- phpcs_clear_sniffer_marks
- phpcs_goto_next_error
- phpcs_show_previous_errors
- phpcs_sniff_this_file
In order to achieve this you need to add the following to one of your key bindings settings file:
{ "keys": ["ctrl+super+t"], "command": "phpcs_clear_sniffer_marks" }
To decide which “Fixer” to use, you can do:
{ "keys": ["super+k", "super+f"], "command": "phpcs_fix_this_file", "args": {"tool": "CodeBeautifier"}},
or
{ "keys": ["super+k", "super+f"], "command": "phpcs_fix_this_file", "args": {"tool": "Fixer"}},
You can then change the ctrl+super+t combination to something of your choosing.