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
@@ -11,9 +11,7 @@ use Illuminate\Support\Facades\DB;
class TeacherDashboardService
{
public function __construct(private TeacherConfigService $configService)
{
}
public function __construct(private TeacherConfigService $configService) {}
public function classView(int $userId, ?int $requestedClassSectionId = null): array
{
@@ -29,7 +27,7 @@ class TeacherDashboardService
->map(fn ($r) => strtolower((string) $r))
->all();
if (!array_intersect($roles, ['teacher', 'teacher_assistant'])) {
if (! array_intersect($roles, ['teacher', 'teacher_assistant'])) {
throw new \RuntimeException('Access denied.');
}
@@ -50,24 +48,24 @@ class TeacherDashboardService
$activeClassSectionId = null;
if ($requestedClassSectionId && in_array($requestedClassSectionId, $classSectionIds, true)) {
$activeClassSectionId = $requestedClassSectionId;
} elseif (!empty($classSectionIds)) {
} elseif (! empty($classSectionIds)) {
$activeClassSectionId = $classSectionIds[0];
}
$studentsBySection = [];
if (!empty($classSectionIds)) {
if (! empty($classSectionIds)) {
$students = StudentClass::getStudentsByClassSectionIds($classSectionIds);
if (!empty($students)) {
if (! empty($students)) {
$studentIds = array_values(array_unique(array_map(
static fn (array $row) => (int) ($row['student_id'] ?? 0),
$students
)));
$studentIds = array_values(array_filter($studentIds));
$conditionsByStudent = !empty($studentIds)
$conditionsByStudent = ! empty($studentIds)
? StudentMedicalCondition::getMedicalByStudentIds($studentIds)
: [];
$allergiesByStudent = !empty($studentIds)
$allergiesByStudent = ! empty($studentIds)
? StudentAllergy::getAllergiesByStudentIds($studentIds)
: [];
@@ -89,7 +87,7 @@ class TeacherDashboardService
}
$assignedNames = [];
if (!empty($classSectionIds)) {
if (! empty($classSectionIds)) {
$rows = DB::table('teacher_class as tc')
->select('tc.class_section_id', 'tc.position', 'u.firstname', 'u.lastname')
->join('users as u', 'u.id', '=', 'tc.teacher_id')
@@ -103,7 +101,7 @@ class TeacherDashboardService
foreach ($rows as $row) {
$sid = (int) ($row->class_section_id ?? 0);
$pos = strtolower((string) ($row->position ?? ''));
$name = trim(($row->firstname ?? '') . ' ' . ($row->lastname ?? ''));
$name = trim(($row->firstname ?? '').' '.($row->lastname ?? ''));
if ($sid === 0 || $name === '') {
continue;
}