Skip to content

Commit

Permalink
fix psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <[email protected]>
szaimen committed Mar 10, 2023
1 parent cbc19c1 commit c5bfdbb
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions php/psalm.xml
Original file line number Diff line number Diff line change
@@ -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"
>
<projectFiles>
<directory name="templates"/>
5 changes: 4 additions & 1 deletion php/src/Data/ConfigurationManager.php
Original file line number Diff line number Diff line change
@@ -78,7 +78,10 @@ public function GetLastBackupTime() : string {
}

$lastBackupLines = explode("\n", $content);
$lastBackupLine = $lastBackupLines[sizeof($lastBackupLines) - 2];
$lastBackupLine = "";
if (count($lastBackupLines) >= 2) {
$lastBackupLine = $lastBackupLines[sizeof($lastBackupLines) - 2];
}
if ($lastBackupLine === "") {
return '';
}

0 comments on commit c5bfdbb

Please sign in to comment.