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 262K
  • Win 151K
  • OS X 58K
  • Linux 53K
Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12
Windows 143 181 126 129 183 193 180 210 206 113 148 212 246 241 172 97 115 99 135 137 165 176 126 87 84 128 122 162 72 141 89 101 130 141 140 185 151 89 109 148 140 137 114 156 97 101
OS X 43 61 48 40 43 54 56 59 54 33 43 80 92 67 42 37 27 23 41 38 40 48 39 17 42 40 51 43 33 45 15 18 38 51 56 42 48 11 19 28 22 35 38 48 29 34
Linux 42 53 36 30 43 66 46 65 65 31 32 64 92 63 35 33 30 27 59 42 42 47 48 33 28 37 46 52 37 46 22 28 46 49 46 43 60 36 40 45 48 48 35 34 21 30

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.