add test batches
This commit is contained in:
@@ -10,7 +10,7 @@ class IpBanCommandService
|
||||
public function banNow(?int $id, ?string $ip, int $hours): ?IpAttempt
|
||||
{
|
||||
$row = $this->findRow($id, $ip);
|
||||
if (! $row) {
|
||||
if (!$row) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ class IpBanCommandService
|
||||
$row->blocked_until = $blockedUntil;
|
||||
$row->attempts = $attempts;
|
||||
$row->save();
|
||||
|
||||
return $row->refresh();
|
||||
});
|
||||
}
|
||||
@@ -29,7 +28,7 @@ class IpBanCommandService
|
||||
public function unbanOne(?int $id, ?string $ip): ?IpAttempt
|
||||
{
|
||||
$row = $this->findRow($id, $ip);
|
||||
if (! $row) {
|
||||
if (!$row) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -37,7 +36,6 @@ class IpBanCommandService
|
||||
$row->blocked_until = null;
|
||||
$row->attempts = 0;
|
||||
$row->save();
|
||||
|
||||
return $row->refresh();
|
||||
});
|
||||
}
|
||||
@@ -69,7 +67,6 @@ class IpBanCommandService
|
||||
if (function_exists('utc_now')) {
|
||||
return (string) utc_now();
|
||||
}
|
||||
|
||||
return now('UTC')->toDateTimeString();
|
||||
}
|
||||
|
||||
@@ -79,7 +76,6 @@ class IpBanCommandService
|
||||
if (function_exists('utc_now')) {
|
||||
return (string) date('Y-m-d H:i:s', strtotime("+{$hours} hours", strtotime((string) utc_now())));
|
||||
}
|
||||
|
||||
return now('UTC')->addHours($hours)->toDateTimeString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user