This linter plugin for SublimeLinter provides an interface to phpcs. It will be used with files that have the “PHP”, “HTML” and “HTML5” syntax.
SublimeLinter must be installed in order to use this plugin.
Please use Package Control to install the linter plugin.
Before using this plugin, you must ensure that phpcs
is installed on your system, preferably somewhere in your PATH. To install phpcs
, follow the instructions on https://github.com/squizlabs/PHP_CodeSniffer#installation.
- SublimeLinter settings: http://sublimelinter.readthedocs.org/en/latest/settings.html
- Linter settings: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html
It is possible to specify the phpcs
executable that should be used to lint your code on a per-project level.
Example:
{
"SublimeLinter": {
"linters": {
"phpcs": {
"cmd": "${project}/vendor/bin/phpcs"
}
}
}
}
You can set up your project settings to use a specific standard using the following:
{
"SublimeLinter": {
"linters": {
"phpcs": {
"standard": "${project}/phpcs.xml"
}
}
}
}