SonarPHP fails to parse CSS statements to be printed with conditions

,

SonarPHP 3.2.0.4868 + SonarCSS 1.1.1.1010

Scan fails with “Unknown word” on several PHP files. The line number always points to an echo statement with a partial CSS statement that is enclosed in a PHP if statement.

All those spots are of the form:
echo “<th”;
if ($inv[“abgeschlossen”]==‘nein’) {
echo " style=‘font-style: italic;’";
}
echo “>”.db_date_to_human_date($inv[“datum”])."";

or
echo "

“.$wochentage[$w].” “.date(“d.m.”, $date).”\n";

i.e. a HTML tag or style attribute that spans over several lines with a condition in between.

I tried to create a minimal example, but sonar-scanner never failed on those.

Are you sure this code reproduces the problem? I’m not able to do it

Hi, Elena!

[Lena] Lena https://community.sonarsource.com/u/lena Elena Vilchik
https://community.sonarsource.com/u/lena SonarSourcer
October 21

Are you sure this code reproduces the problem? I’m not able to do it

As I wrote in my report: I was not able to produce a minimal example
that triggers the problem. I could send you the original files for testing.

Flo

Yes, original file will help a lot!