PSR-2 CodeSniffer standard for eclipse plugin PHP_CodeSniffer

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

This plugin contains some standards for verification, but not with PSR-2.

This plugin allows you to define a user standard by providing a file.

I downloaded this psr2 standard ( https://github.com/squizlabs/PHP_CodeSniffer/tree/master/CodeSniffer/Standards/PSR2 ) and defined in the eclipse plugin as a user standard.

But this will not work (eclipse does not tell me about any error). This happens if I configure a non-standard standard (standard plugin).

Anyone having this problem? Any other way to set up eclipse to tell me (while I am coding) where is the unsupported PSR-2 code?

+5
source share
1 answer

According to this google groups post , the PSR-2 standard is defined in the Symfony plugin ( which I suppose to be this ). So, instead of creating your own, you can use strangers.

Side note. This may not be the best answer, since it probably comes with overheads that you don't need if you are not using Symfony.

Added: Possible alternative here , but it looks like it was tested only in Zend Studio, not in PDT

+1
source

Source: https://habr.com/ru/post/1208336/


All Articles