instances added god may help

This commit is contained in:
2026-02-23 12:58:19 +01:00
parent 25370a1a55
commit 99db252f60
290 changed files with 9858 additions and 4914 deletions

View File

@@ -7,7 +7,7 @@ use MintyPHP\Repository\Support\RepoQuery;
class ApiAuditLogRepository
{
public static function create(array $data): int|false
public function create(array $data): int|false
{
$id = DB::insert(
'insert into api_audit_log (
@@ -32,7 +32,7 @@ class ApiAuditLogRepository
return $id ? (int) $id : false;
}
public static function listPaged(array $filters): array
public function listPaged(array $filters): array
{
$search = trim((string) ($filters['search'] ?? ''));
$status = strtolower(trim((string) ($filters['status'] ?? '')));
@@ -134,7 +134,7 @@ class ApiAuditLogRepository
$normalized = [];
if (is_array($rows)) {
foreach ($rows as $row) {
$item = self::normalizeRow($row);
$item = $this->normalizeRow($row);
if ($item !== null) {
$normalized[] = $item;
}
@@ -147,7 +147,7 @@ class ApiAuditLogRepository
];
}
public static function find(int $id): ?array
public function find(int $id): ?array
{
$row = DB::selectOne(
'select
@@ -181,10 +181,10 @@ class ApiAuditLogRepository
(string) $id
);
return self::normalizeRow($row);
return $this->normalizeRow($row);
}
public static function purgeOlderThanDays(int $days): int
public function purgeOlderThanDays(int $days): int
{
if ($days <= 0) {
return 0;
@@ -197,7 +197,7 @@ class ApiAuditLogRepository
return is_int($deleted) ? $deleted : 0;
}
private static function normalizeRow(mixed $row): ?array
private function normalizeRow(mixed $row): ?array
{
if (!is_array($row)) {
return null;
@@ -220,4 +220,3 @@ class ApiAuditLogRepository
return $log;
}
}