Skip to content

Commit

Permalink
Don't use customvar values from customvar table other than for empt…
Browse files Browse the repository at this point in the history
…y `array` & `dictionary`
  • Loading branch information
yhabteab committed Oct 11, 2023
1 parent 701797e commit b692655
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/Icingadb/Model/CustomvarFlat.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function unFlattenVars(Traversable $flattenedVars): array
// Since empty custom vars of type dictionaries and arrays have null values in customvar_flat table,
// we won't be able to render them as such. Therefore, we have to use the value of the `customvar`
// table if it's not null, otherwise the current value, which is a "null" string.
$data[$step] = $source[$step] ?? $value;
$data[$step] = $value === null && $source[$step] ?? null === [] ? $source[$step] : $value;

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.2 on ubuntu-latest

Expression on left side of ?? is not nullable.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.2 on ubuntu-latest

Strict comparison using === between null and array{} will always evaluate to false.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.3 on ubuntu-latest

Expression on left side of ?? is not nullable.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.3 on ubuntu-latest

Strict comparison using === between null and array{} will always evaluate to false.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.4 on ubuntu-latest

Expression on left side of ?? is not nullable.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.4 on ubuntu-latest

Strict comparison using === between null and array{} will always evaluate to false.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.0 on ubuntu-latest

Expression on left side of ?? is not nullable.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.0 on ubuntu-latest

Strict comparison using === between null and array{} will always evaluate to false.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.1 on ubuntu-latest

Expression on left side of ?? is not nullable.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.1 on ubuntu-latest

Strict comparison using === between null and array{} will always evaluate to false.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.2 on ubuntu-latest

Expression on left side of ?? is not nullable.

Check failure on line 129 in library/Icingadb/Model/CustomvarFlat.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.2 on ubuntu-latest

Strict comparison using === between null and array{} will always evaluate to false.
}
};

Expand Down

0 comments on commit b692655

Please sign in to comment.