Fix Laravel Pint formatting

This commit is contained in:
root
2026-06-09 00:03:03 -04:00
parent 8d4d610b82
commit b5fd4a4ca1
1414 changed files with 11317 additions and 10201 deletions
+25 -26
View File
@@ -9,8 +9,7 @@ class BadgeUserLookupService
{
public function __construct(
protected BadgeTextFormatter $formatter
) {
}
) {}
public function fetchStaffList(?string $schoolYear, array $selectedUserIds = []): array
{
@@ -25,7 +24,7 @@ class BadgeUserLookupService
])
->groupBy('users.id', 'users.firstname', 'users.lastname');
if (!empty($selectedUserIds)) {
if (! empty($selectedUserIds)) {
$query->whereIn('users.id', $selectedUserIds);
}
@@ -65,7 +64,7 @@ class BadgeUserLookupService
])
->where('tc.teacher_id', $userId);
if (!empty($schoolYear)) {
if (! empty($schoolYear)) {
$query->where('tc.school_year', $schoolYear);
}
@@ -75,12 +74,12 @@ class BadgeUserLookupService
->orderByDesc('tc.id')
->first();
if (!$row || empty($row->class_section_id)) {
if (! $row || empty($row->class_section_id)) {
return null;
}
return [
'class_section_id' => (int) $row->class_section_id,
'class_section_id' => (int) $row->class_section_id,
'class_section_name' => $row->class_section_name ?? null,
];
}
@@ -92,12 +91,12 @@ class BadgeUserLookupService
->where('id', $id)
->first();
if (!$u) {
if (! $u) {
return null;
}
$userId = (int) $u->user_id;
$fullname = trim(($u->firstname ?? '') . ' ' . ($u->lastname ?? ''));
$fullname = trim(($u->firstname ?? '').' '.($u->lastname ?? ''));
$schoolId = trim((string) ($u->school_id ?? ''));
if ($schoolId === '') {
$schoolId = trim((string) ($u->account_id ?? ''));
@@ -124,7 +123,7 @@ class BadgeUserLookupService
->select(['class_section_id', 'updated_at', 'id', 'position', 'school_year'])
->where('teacher_id', $userId);
if (!empty($schoolYear)) {
if (! empty($schoolYear)) {
$tcQuery->where('school_year', $schoolYear);
}
@@ -136,7 +135,7 @@ class BadgeUserLookupService
$position = strtolower(trim((string) ($assignment->position ?? '')));
$className = null;
if (!empty($classId)) {
if (! empty($classId)) {
$className = $this->resolveClassName((int) $classId);
}
@@ -144,7 +143,7 @@ class BadgeUserLookupService
$roleLabel = 'Teacher Assistant';
} elseif ($position === 'teacher' || $position === 'main') {
$roleLabel = 'Teacher';
} elseif (!empty($allRoles)) {
} elseif (! empty($allRoles)) {
$roleLabel = $allRoles[0];
} else {
$roleLabel = 'Staff';
@@ -161,27 +160,27 @@ class BadgeUserLookupService
]);
$jobTitle = '';
if (!empty($roleLabel) && !empty($className)) {
if (! empty($roleLabel) && ! empty($className)) {
$jobTitle = "{$roleLabel} - {$className}";
} elseif (!empty($roleLabel)) {
} elseif (! empty($roleLabel)) {
$jobTitle = $roleLabel;
} elseif (!empty($className)) {
} elseif (! empty($className)) {
$jobTitle = $className;
}
return [
'user_id' => $userId,
'name' => $fullname !== '' ? $fullname : 'STAFF',
'role' => $roleLabel,
'roles' => $rolesCsv,
'class_section_id' => $classId ? (int) $classId : null,
'class_section_name' => $className,
'job_title' => $jobTitle,
'school_name' => 'Al Rahma Sunday School',
'school_id' => $schoolId,
'school_logo' => $schoolLogo,
'isgl_logo' => $isglLogo,
'school_year' => $assignment->school_year ?? $schoolYear,
'user_id' => $userId,
'name' => $fullname !== '' ? $fullname : 'STAFF',
'role' => $roleLabel,
'roles' => $rolesCsv,
'class_section_id' => $classId ? (int) $classId : null,
'class_section_name' => $className,
'job_title' => $jobTitle,
'school_name' => 'Al Rahma Sunday School',
'school_id' => $schoolId,
'school_logo' => $schoolLogo,
'isgl_logo' => $isglLogo,
'school_year' => $assignment->school_year ?? $schoolYear,
];
}