forked from fa/breadcrumb-the-shire
instances added god may help
This commit is contained in:
@@ -6,7 +6,7 @@ use MintyPHP\DB;
|
||||
|
||||
class SchedulerRuntimeRepository
|
||||
{
|
||||
public static function touchHeartbeat(string $result, ?string $errorCode = null, ?string $heartbeatAtUtc = null): bool
|
||||
public function touchHeartbeat(string $result, ?string $errorCode = null, ?string $heartbeatAtUtc = null): bool
|
||||
{
|
||||
$heartbeatAtUtc = trim((string) ($heartbeatAtUtc ?? ''));
|
||||
if ($heartbeatAtUtc === '') {
|
||||
@@ -17,7 +17,7 @@ class SchedulerRuntimeRepository
|
||||
if ($result === '') {
|
||||
$result = 'ok';
|
||||
}
|
||||
$errorCode = self::nullableTrim($errorCode);
|
||||
$errorCode = $this->nullableTrim($errorCode);
|
||||
|
||||
$updated = DB::update(
|
||||
'insert into scheduler_runtime_status (id, last_heartbeat_at, last_result, last_error_code) ' .
|
||||
@@ -34,7 +34,7 @@ class SchedulerRuntimeRepository
|
||||
return $updated !== false;
|
||||
}
|
||||
|
||||
public static function findStatus(): ?array
|
||||
public function findStatus(): ?array
|
||||
{
|
||||
$row = DB::selectOne('select * from scheduler_runtime_status where id = 1 limit 1');
|
||||
if (!is_array($row)) {
|
||||
@@ -44,7 +44,7 @@ class SchedulerRuntimeRepository
|
||||
return is_array($item) ? $item : null;
|
||||
}
|
||||
|
||||
private static function nullableTrim(?string $value): ?string
|
||||
private function nullableTrim(?string $value): ?string
|
||||
{
|
||||
$value = trim((string) $value);
|
||||
return $value !== '' ? $value : null;
|
||||
|
||||
Reference in New Issue
Block a user