NOTE: I recommend that you use the flycheck.
Because, you can run the checker more than one. Of course, including phpcs
.
PHP CodeSniffer for Emacs with flymake-mode.
To use PHP CodeSniffer with Emacs, you will need PHP CodeSniffer installed.
You should be able to run
$ phpcs
and, you'll also need to install flymake-easy.
You'll need to add the directory containing flymake-phpcs.el
to your load-path
.
If not, also add to your config
(add-to-list 'load-path "~/.emacs.d/path/to/flymake-phpcs.el")
(require 'flymake-phpcs)
(add-hook 'php-mode-hook 'flymake-phpcs-load)
(custom-set-variables
'(flymake-phpcs-standard "PSR2"))
or
(custom-set-variables
'(flymake-phpcs-standard "/path/to/MyStandard"))
By default, the location of the phpcs
command is searched.
(custom-set-variables
'(flymake-phpcs-command "/path/to/phpcs"))
one of 'tempdir or 'inplace (default).
(custom-set-variables
'(flymake-phpcs-location 'tempdir))