I'm analyzing a PHP code using Sonarqube, and I've noticed that in almost all files I have this error:
"Each PHP statement must be on a line by itself" (DisallowMultipleStatementsSameLine)
But when I check this files seems that there is no error.
For example, in this file the error is raised:
<?php
/**
* Category of the question
*/
class Category {
public $categoryId;
public $name;
}
?>
How can be?
The problem was the line endings. Changing the line endings to "Linux line endings" makes the problem disapear
As google brought me here -> same issue is reported when there is a double semicolon on the end of the line, like someCall();;
.