PSR-2 CodeSniffer standard for eclipse plugin PHP_CodeSniffer

3k views Asked by At

I'm using this eclipse plugin (http://www.phpsrc.org/projects/pti-php-codesniffer/wiki/) to check PHP code style.

This plugin comes with some standards to check, but no with PSR-2.

This plugin lets define a custom standard by giving a file.

I've donwload this psr2 standard (https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/PSR2) and defined in eclipse plugin like a custom standard.

But it doesn't work (eclipse is not telling me any error I have). It does if I configure a no custom standard (a plugin included standard).

Anyone with this problem? Any other way to configure eclipse to tell me (while I'm coding) where are PSR-2 non compliance code?

1

There are 1 answers

0
DanielM On

According to this google groups post, the PSR-2 standard is defined in a Symfony plugin (which I assume to be this one). So, rather than make your own, you could use someone else's.

Side note: This may not be the best answer as it probably comes with overhead you don't need if you're not using Symfony.

Added: Potential alternative here, but it looks like it's only been tested in Zend Studio, not PDT