add test batches

This commit is contained in:
root
2026-06-08 23:45:55 -04:00
parent c792b8be05
commit 8d4d610b82
1480 changed files with 22587 additions and 10762 deletions
+7 -8
View File
@@ -7,7 +7,9 @@ use DateTimeImmutable;
class SemesterRangeService
{
public function __construct(private SemesterConfigService $configService) {}
public function __construct(private SemesterConfigService $configService)
{
}
public function getSchoolYearRange(string $schoolYear): array
{
@@ -29,7 +31,7 @@ class SemesterRangeService
public function getSemesterRange(string $schoolYear, string $semester): ?array
{
if (! preg_match('/^(\\d{4})-(\\d{4})$/', $schoolYear, $m)) {
if (!preg_match('/^(\\d{4})-(\\d{4})$/', $schoolYear, $m)) {
return null;
}
$y1 = (int) $m[1];
@@ -55,7 +57,6 @@ class SemesterRangeService
if ($value === 'spring') {
return 'Spring';
}
return '';
}
@@ -102,15 +103,13 @@ class SemesterRangeService
if (preg_match('/^(\\d{4})-(\\d{4})$/', $schoolYear, $m)) {
$y1 = (int) $m[1];
$y2 = (int) $m[2];
return [new DateTimeImmutable($y1.'-09-01'), new DateTimeImmutable($y2.'-06-30')];
return [new DateTimeImmutable($y1 . '-09-01'), new DateTimeImmutable($y2 . '-06-30')];
}
$currentYear = (int) date('Y');
return [
new DateTimeImmutable($currentYear.'-09-01'),
new DateTimeImmutable(($currentYear + 1).'-06-30'),
new DateTimeImmutable($currentYear . '-09-01'),
new DateTimeImmutable(($currentYear + 1) . '-06-30'),
];
}
}