Jump to content

Validator issue psr2


shacker

Recommended Posts

Actually no problems here. I also use PHPStorm , i set my code style to PSR-2 , with some slight modifications and Ctrl+Alt+L fixes most of the standard requirements. 

Only thing i should do manually is cutting longer lines.

I have also installed PHP CS and PHP MD and configured them in the PHP storm , to get better feedback for the problems of the code

The validator uses mostly those tools to determine and show you the errors.

 

Actually the Pretashop code  itself doesn't help you to follow at 100% the standard due to some missing parts - autoloading Classes for modules for example.

You should include class files yourself and this raises a warning for side effects.

 

Another thing is _childValidation method .

PSR-2 does not accept methods or fields starting with underscore , so if you override it in admin controller - you are screwed again. 

 

Validator also uses PHPMD for some checks ( unsued parameters for example ) 

 

 

For better results install PHPCS and PHPMD on your system and configure PHPStorm to use them for better highlighting errors 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...