fix gitlab tests
This commit is contained in:
@@ -6,7 +6,9 @@ use App\Models\Incident;
|
||||
|
||||
class IncidentHistoryService
|
||||
{
|
||||
public function __construct(private IncidentLookupService $lookup) {}
|
||||
public function __construct(private IncidentLookupService $lookup)
|
||||
{
|
||||
}
|
||||
|
||||
public function history(?string $schoolYear, ?string $semester): array
|
||||
{
|
||||
@@ -33,7 +35,7 @@ class IncidentHistoryService
|
||||
$updaterIds = [];
|
||||
foreach ($incidents as $incident) {
|
||||
foreach (['updated_by_open', 'updated_by_closed', 'updated_by_canceled'] as $key) {
|
||||
if (! empty($incident[$key])) {
|
||||
if (!empty($incident[$key])) {
|
||||
$updaterIds[] = (int) $incident[$key];
|
||||
}
|
||||
}
|
||||
@@ -44,7 +46,7 @@ class IncidentHistoryService
|
||||
foreach ($incidents as &$incident) {
|
||||
foreach (['updated_by_open', 'updated_by_closed', 'updated_by_canceled'] as $key) {
|
||||
$id = (int) ($incident[$key] ?? 0);
|
||||
$incident[$key.'_name'] = $id > 0 ? ($updaterMap[$id] ?? null) : null;
|
||||
$incident[$key . '_name'] = $id > 0 ? ($updaterMap[$id] ?? null) : null;
|
||||
}
|
||||
|
||||
$gradeValue = $incident['grade'] ?? '';
|
||||
|
||||
Reference in New Issue
Block a user