I have a little issue with SonarQube to scan PHP code.
When scanning the work, there is an error coming a hundred times:
Move this open curly brace to the end of the previous line
This apply on this code for example:
class Edit extends Container
{
It shouldn't as PSR are clear on this topic :
Opening braces for classes MUST go on the next line, and closing braces MUST go on the next line after the body.
Opening braces for methods MUST go on the next line, and closing braces MUST go on the next line after the body.
Opening braces for control structures MUST go on the same line, and closing braces MUST go on the next line after the body
When I look in the detail of the error in Sonar, this is what the rule seems to follow, which is not appropriate:
Sharing some coding conventions is a key point to make it possible for a team to efficiently collaborate. This rule make it mandatory to place open curly braces at the end of lines of code.
And there it shows me the example of the if condition
if(...) {
//...
}
Any idea to follow the proper rule?
Finally I found a solution:
Hope it will help other.