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 250K
  • Win 143K
  • OS X 55K
  • Linux 51K
Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 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
Windows 71 84 96 146 158 167 154 135 88 87 148 146 186 175 136 87 88 143 153 164 139 186 103 129 129 145 140 156 128 87 99 143 157 142 148 153 87 101 141 134 142 145 129 89 116 138
OS X 21 36 25 36 63 52 44 52 24 23 49 60 59 46 42 21 18 36 40 51 39 45 19 22 48 44 51 33 39 21 27 42 52 46 49 56 23 29 35 44 47 62 39 17 24 46
Linux 17 29 38 37 35 47 48 39 31 20 44 47 51 48 52 27 34 52 55 46 52 53 22 30 56 52 52 45 35 27 24 34 55 52 55 42 22 19 47 47 47 47 45 34 20 43

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.