fix gitlab tests
This commit is contained in:
@@ -4,7 +4,6 @@ namespace App\Services\Incidents;
|
||||
|
||||
use App\Models\ClassSection;
|
||||
use App\Models\StudentClass;
|
||||
use Illuminate\Contracts\Support\Arrayable;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class IncidentLookupService
|
||||
@@ -73,7 +72,7 @@ class IncidentLookupService
|
||||
->select('id', 'firstname', 'lastname')
|
||||
->whereIn('id', $userIds)
|
||||
->get()
|
||||
->map(fn ($row) => $row instanceof Arrayable ? $row->toArray() : (array) $row)
|
||||
->map(fn ($row) => $row instanceof \Illuminate\Contracts\Support\Arrayable ? $row->toArray() : (array) $row)
|
||||
->all();
|
||||
|
||||
$map = [];
|
||||
@@ -82,8 +81,8 @@ class IncidentLookupService
|
||||
if ($id === null) {
|
||||
continue;
|
||||
}
|
||||
$name = trim((string) ($row['firstname'] ?? '').' '.(string) ($row['lastname'] ?? ''));
|
||||
$map[(int) $id] = $name !== '' ? $name : ('User #'.$id);
|
||||
$name = trim((string) ($row['firstname'] ?? '') . ' ' . (string) ($row['lastname'] ?? ''));
|
||||
$map[(int) $id] = $name !== '' ? $name : ('User #' . $id);
|
||||
}
|
||||
|
||||
return $map;
|
||||
|
||||
Reference in New Issue
Block a user