giasemis Posted April 23, 2016 Share Posted April 23, 2016 Hello, I am working on a new module and I am dealing with some errors I am receiving from the validator I common stardard type error is this: Expected "if (...) {\n"; found "if(...)\n {\n" appear several times: I am using notepad++ and the code is simple and clear for example: ·if($attributeName·==·'Size') I don't know how to resolve this error Any ideas ? Thank you Link to comment Share on other sites More sharing options...
coeos.pro Posted April 23, 2016 Share Posted April 23, 2016 you have if($attributeName... ? have you try with if ($attributeName... with a space between if and ( Link to comment Share on other sites More sharing options...
giasemis Posted April 23, 2016 Author Share Posted April 23, 2016 Yes, I try with a space between but the error in validator remains Link to comment Share on other sites More sharing options...
razaro Posted April 23, 2016 Share Posted April 23, 2016 Check http://doc.prestashop.com/display/PS16/Coding+Standards Errror says what is a problem but maybe not to noticible. )\n {\n is wrong and correct is ) {\n notic so no new line after closing bracket So not by standards is if() { } and this is good if () { } 1 Link to comment Share on other sites More sharing options...
bellini13 Posted April 24, 2016 Share Posted April 24, 2016 what character encoding are you using with notepad++ ? Link to comment Share on other sites More sharing options...
J. Danse Posted April 24, 2016 Share Posted April 24, 2016 if() { } It's more this one that is correct: if () { } 2 Link to comment Share on other sites More sharing options...
giasemis Posted April 25, 2016 Author Share Posted April 25, 2016 It's more this one that is correct: if () { } Thanks a lot, This format was the answer to that validation error. 1 Link to comment Share on other sites More sharing options...
coeos.pro Posted April 25, 2016 Share Posted April 25, 2016 you have check PSR-2 : else you must use : if () { } 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