diff --git a/php/psalm-baseline.xml b/php/psalm-baseline.xml index 9efde3ff..2a811d04 100644 --- a/php/psalm-baseline.xml +++ b/php/psalm-baseline.xml @@ -1,2 +1,2 @@ - + diff --git a/php/psalm.xml b/php/psalm.xml index 49c40fd4..59601afa 100644 --- a/php/psalm.xml +++ b/php/psalm.xml @@ -6,6 +6,8 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config" errorBaseline="psalm-baseline.xml" + findUnusedBaselineEntry="true" + findUnusedCode="false" > diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index b7f48176..1c257946 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -78,7 +78,10 @@ class ConfigurationManager } $lastBackupLines = explode("\n", $content); - $lastBackupLine = $lastBackupLines[sizeof($lastBackupLines) - 2]; + $lastBackupLine = ""; + if (count($lastBackupLines) >= 2) { + $lastBackupLine = $lastBackupLines[sizeof($lastBackupLines) - 2]; + } if ($lastBackupLine === "") { return ''; }