ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Phpcs

by benmatselby ST2/ST3 Top 100

PHP CodeSniffer, PHP Coding Standard Fixer, Linter and Mess Detector Support for Sublime Text

Details

Installs

  • Total 233K
  • Win 133K
  • OS X 53K
  • Linux 48K
Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9
Windows 83 117 145 157 164 144 144 95 82 128 155 151 181 144 107 108 169 178 172 154 142 107 94 135 177 173 163 141 102 112 144 178 171 176 178 105 116 142 197 171 171 194 112 124 154 212
OS X 19 27 45 59 51 42 48 23 21 35 43 48 65 43 21 19 39 56 56 41 52 21 27 58 49 45 57 46 22 29 39 37 50 67 43 28 24 57 63 50 53 46 31 31 42 46
Linux 34 23 46 38 67 54 41 35 31 42 49 44 64 40 24 25 48 54 58 57 53 30 27 59 47 64 58 36 28 34 42 68 46 50 57 25 37 48 44 61 58 45 30 40 55 57

Readme

Source
raw.​githubusercontent.​com

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.