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 244K
  • Win 140K
  • OS X 54K
  • Linux 50K
Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 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
Windows 143 142 148 153 87 101 141 134 142 145 129 89 116 138 138 171 163 157 98 116 146 133 152 137 137 86 113 134 169 151 169 162 92 101 150 141 164 145 143 99 85 145 188 166 167 173
OS X 48 46 49 56 23 29 35 44 47 62 39 17 24 46 38 55 50 37 16 21 43 38 45 41 44 21 24 50 58 47 55 54 16 24 55 40 54 54 39 23 27 52 47 45 56 54
Linux 50 52 55 42 22 19 47 47 47 47 45 34 20 43 51 57 33 54 28 31 49 44 51 56 59 31 29 57 44 55 38 61 24 31 53 37 48 53 54 28 27 34 44 47 55 48

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.