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
+17 -18
View File
@@ -8,8 +8,7 @@ class BadgeFormDataService
protected BadgeUserLookupService $lookupService,
protected BadgeStudentLookupService $studentLookupService,
protected BadgeTextFormatter $formatter
) {
}
) {}
public function build(
?string $schoolYear,
@@ -24,7 +23,7 @@ class BadgeFormDataService
$students = $this->studentLookupService->fetchStudentList($schoolYear, $selectedStudentIds);
foreach ($users as &$u) {
if (!isset($u['user_id']) && isset($u['id'])) {
if (! isset($u['user_id']) && isset($u['id'])) {
$u['user_id'] = (int) $u['id'];
}
@@ -46,7 +45,7 @@ class BadgeFormDataService
$u['class_section_id'] = $u['class_section_id'] ?? null;
$u['class_section_name'] = $u['class_section_name'] ?? null;
$u['entity_type'] = 'user';
$u['row_id'] = 'user:' . (int) ($u['user_id'] ?? 0);
$u['row_id'] = 'user:'.(int) ($u['user_id'] ?? 0);
$u['role_group'] = $this->detectRoleGroup(
strtolower((string) ($u['roles_raw'] ?? ($u['role_name_raw'] ?? '')))
);
@@ -57,7 +56,7 @@ class BadgeFormDataService
$rolesDetect = strtolower((string) ($u['roles_raw'] ?? ($u['role_name_raw'] ?? '')));
$isTeacherish = str_contains($rolesDetect, 'teacher') || preg_match('/\bta\b/', $rolesDetect);
if ($isTeacherish && !empty($u['user_id'])) {
if ($isTeacherish && ! empty($u['user_id'])) {
$assign = $this->lookupService->getLatestClassForUser((int) $u['user_id'], $schoolYear);
if ($assign) {
$u['class_section_id'] = $assign['class_section_id'] ?? null;
@@ -69,7 +68,7 @@ class BadgeFormDataService
foreach ($students as &$student) {
$student['entity_type'] = 'student';
$student['row_id'] = 'student:' . (int) ($student['student_id'] ?? 0);
$student['row_id'] = 'student:'.(int) ($student['student_id'] ?? 0);
$student['role_group'] = 'student';
$student['class_section_id'] = null;
@@ -84,17 +83,17 @@ class BadgeFormDataService
$rows = array_merge($users, $students);
usort($rows, static function (array $a, array $b): int {
return strcasecmp(
trim((string) ($a['lastname'] ?? '')) . ' ' . trim((string) ($a['firstname'] ?? '')),
trim((string) ($b['lastname'] ?? '')) . ' ' . trim((string) ($b['firstname'] ?? ''))
trim((string) ($a['lastname'] ?? '')).' '.trim((string) ($a['firstname'] ?? '')),
trim((string) ($b['lastname'] ?? '')).' '.trim((string) ($b['firstname'] ?? ''))
);
});
$rolesTabs = [
'all' => 'All',
'all' => 'All',
'teacher' => 'Teachers',
'ta' => 'Teacher Assistants',
'admin' => 'Admins',
'staff' => 'Staff',
'ta' => 'Teacher Assistants',
'admin' => 'Admins',
'staff' => 'Staff',
'student' => 'Students',
];
@@ -103,13 +102,13 @@ class BadgeFormDataService
: 'all';
return [
'users' => $rows,
'schoolYears' => $this->lookupService->getAvailableSchoolYears(),
'selectedYear' => $schoolYear,
'selectedUserIds' => $selectedUserIds,
'users' => $rows,
'schoolYears' => $this->lookupService->getAvailableSchoolYears(),
'selectedYear' => $schoolYear,
'selectedUserIds' => $selectedUserIds,
'selectedStudentIds' => $selectedStudentIds,
'rolesTabs' => $rolesTabs,
'active_role' => $activeRole,
'rolesTabs' => $rolesTabs,
'active_role' => $activeRole,
];
}