shacker Posted September 3, 2015 Share Posted September 3, 2015 AFter test some modules, looks like the validator dont fill really the requests of psr2 I use phpstorm and get a lot of errors reformating the code into psr2 from the validator, so i guess not fill really the psr2 standards Link to comment Share on other sites More sharing options...
chazzbg Posted September 4, 2015 Share Posted September 4, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now