Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PSR-2 CodeSniffer standard for eclipse plugin PHP_CodeSniffer

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?

like image 818
Jordi Martínez Avatar asked Nov 10 '22 22:11

Jordi Martínez


1 Answers

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

like image 69
DanielM Avatar answered Nov 14 '22 22:11

DanielM