fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
@@ -14,7 +14,8 @@ class SectionPlacementPreviewService
private PromotionSectionCapacityService $capacityService,
private PlacementPoolBuilder $poolBuilder,
private BalancedSectionPlacementService $placementService
) {}
) {
}
public function createDraft(
string $fromSchoolYear,
@@ -118,12 +119,12 @@ class SectionPlacementPreviewService
->where('is_event_only', 0)
->exists();
if ($duplicate) {
throw new RuntimeException('Student '.$studentId.' already has a target-year class placement.');
throw new RuntimeException('Student ' . $studentId . ' already has a target-year class placement.');
}
$sectionId = $sectionMap[(int) $student->planned_section_index] ?? null;
if ($sectionId === null) {
throw new RuntimeException('Missing target section for planned section '.$student->planned_section_index.'.');
throw new RuntimeException('Missing target section for planned section ' . $student->planned_section_index . '.');
}
DB::table('student_class')->insert([
@@ -132,7 +133,7 @@ class SectionPlacementPreviewService
'is_event_only' => 0,
'semester' => $semester,
'school_year' => $batch->to_school_year,
'description' => 'Finalized from section placement batch #'.$batch->getKey(),
'description' => 'Finalized from section placement batch #' . $batch->getKey(),
'created_at' => now(),
'updated_at' => now(),
'updated_by' => $userId,
@@ -153,7 +154,7 @@ class SectionPlacementPreviewService
private function ensureSections(SectionPlacementBatch $batch, string $semester): array
{
if (! $batch->to_grade_level_id) {
if (!$batch->to_grade_level_id) {
throw new RuntimeException('to_grade_level_id is required to finalize placement sections.');
}
@@ -175,7 +176,6 @@ class SectionPlacementPreviewService
if ($existing) {
$map[$i] = (int) $existing;
continue;
}
@@ -198,8 +198,7 @@ class SectionPlacementPreviewService
private function sectionName(int $classId, string $suffix, string $schoolYear): string
{
$className = DB::table('classes')->where('id', $classId)->value('class_name');
$base = $className ? (string) $className : ('Class '.$classId);
return $base.'-'.$suffix.' '.$schoolYear;
$base = $className ? (string) $className : ('Class ' . $classId);
return $base . '-' . $suffix . ' ' . $schoolYear;
}
}