Fix Laravel Pint formatting
This commit is contained in:
@@ -11,9 +11,7 @@ use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CurrentIncidentService
|
||||
{
|
||||
public function __construct(private IncidentLookupService $lookup)
|
||||
{
|
||||
}
|
||||
public function __construct(private IncidentLookupService $lookup) {}
|
||||
|
||||
public function listCurrent(): array
|
||||
{
|
||||
@@ -23,7 +21,7 @@ class CurrentIncidentService
|
||||
$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];
|
||||
}
|
||||
}
|
||||
@@ -33,7 +31,7 @@ class CurrentIncidentService
|
||||
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;
|
||||
}
|
||||
}
|
||||
unset($incident);
|
||||
@@ -62,7 +60,7 @@ class CurrentIncidentService
|
||||
->get()
|
||||
->map(fn ($student) => [
|
||||
'id' => (int) $student->id,
|
||||
'name' => trim((string) $student->firstname . ' ' . (string) $student->lastname),
|
||||
'name' => trim((string) $student->firstname.' '.(string) $student->lastname),
|
||||
])
|
||||
->all();
|
||||
}
|
||||
@@ -77,7 +75,7 @@ class CurrentIncidentService
|
||||
$grade = (string) $payload['grade'];
|
||||
|
||||
$student = Student::query()->find($studentId);
|
||||
if (!$student) {
|
||||
if (! $student) {
|
||||
return [
|
||||
'ok' => false,
|
||||
'message' => 'Student not found.',
|
||||
@@ -121,7 +119,7 @@ class CurrentIncidentService
|
||||
|
||||
$incident = CurrentIncident::query()->create([
|
||||
'student_id' => $student->id,
|
||||
'student_name' => trim((string) $student->firstname . ' ' . (string) $student->lastname),
|
||||
'student_name' => trim((string) $student->firstname.' '.(string) $student->lastname),
|
||||
'grade' => $grade,
|
||||
'incident' => $incidentType,
|
||||
'incident_datetime' => $currentDateTime,
|
||||
@@ -149,7 +147,7 @@ class CurrentIncidentService
|
||||
public function closeIncident(int $incidentId, string $closeDescription, ?string $actionTaken, int $userId): array
|
||||
{
|
||||
$incident = CurrentIncident::query()->find($incidentId);
|
||||
if (!$incident) {
|
||||
if (! $incident) {
|
||||
return ['ok' => false, 'message' => 'Incident not found.'];
|
||||
}
|
||||
|
||||
@@ -171,7 +169,7 @@ class CurrentIncidentService
|
||||
public function cancelIncident(int $incidentId, ?string $cancelDescription, ?string $actionTaken, int $userId): array
|
||||
{
|
||||
$incident = CurrentIncident::query()->find($incidentId);
|
||||
if (!$incident) {
|
||||
if (! $incident) {
|
||||
return ['ok' => false, 'message' => 'Incident not found.'];
|
||||
}
|
||||
|
||||
@@ -228,6 +226,6 @@ class CurrentIncidentService
|
||||
return $append;
|
||||
}
|
||||
|
||||
return $existing . PHP_EOL . $append;
|
||||
return $existing.PHP_EOL.$append;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user