instances added god may help
This commit is contained in:
@@ -6,7 +6,7 @@ use MintyPHP\DB;
|
||||
|
||||
class RateLimitRepository
|
||||
{
|
||||
public static function findByScopeAndHash(string $scope, string $subjectHash): ?array
|
||||
public function findByScopeAndHash(string $scope, string $subjectHash): ?array
|
||||
{
|
||||
$row = DB::selectOne(
|
||||
'select id, scope, subject_hash, hits, window_started_at, blocked_until, created, modified from request_rate_limits where scope = ? and subject_hash = ? limit 1',
|
||||
@@ -19,7 +19,7 @@ class RateLimitRepository
|
||||
return $row['request_rate_limits'];
|
||||
}
|
||||
|
||||
public static function create(
|
||||
public function create(
|
||||
string $scope,
|
||||
string $subjectHash,
|
||||
int $hits,
|
||||
@@ -37,7 +37,7 @@ class RateLimitRepository
|
||||
return $result !== false;
|
||||
}
|
||||
|
||||
public static function updateStateById(
|
||||
public function updateStateById(
|
||||
int $id,
|
||||
int $hits,
|
||||
string $windowStartedAt,
|
||||
@@ -57,7 +57,7 @@ class RateLimitRepository
|
||||
return $result !== false;
|
||||
}
|
||||
|
||||
public static function deleteByScopeAndHash(string $scope, string $subjectHash): bool
|
||||
public function deleteByScopeAndHash(string $scope, string $subjectHash): bool
|
||||
{
|
||||
$result = DB::delete(
|
||||
'delete from request_rate_limits where scope = ? and subject_hash = ?',
|
||||
|
||||
Reference in New Issue
Block a user