Skip to content

Commit a9f87fe

Browse files
authored
Merge pull request #18 from Vendic/bugfix/cached-status-resolver-older-php-syntax
Made fallback status enum value retrieval compatible
2 parents 67b6cd9 + 265138d commit a9f87fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Model/CachedStatusResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ public function setMessagesByStatus(array $messagesByStatus): self
163163

164164
public function getFlappingStatus(string $oldStatus, string $newStatus): CheckStatus
165165
{
166-
$statusToSet = CheckStatus::STATUS_OK;
166+
$statusToSet = CheckStatus::STATUS_OK->name;
167167
if (self::STATUSES_BY_SEVERITY[$oldStatus] < self::STATUSES_BY_SEVERITY[$newStatus]) {
168168
$statusToSet = "STATUS_" . strtoupper($oldStatus);
169169
} else {
170170
$statusToSet = "STATUS_" . strtoupper($newStatus);
171171
}
172172

173-
return CheckStatus::{$statusToSet};
173+
return constant("\Vendic\OhDear\Api\Data\CheckStatus::{$statusToSet}");
174174
}
175175

176176
private function getStatusTimeThreshold(): int

0 commit comments

Comments
 (0)