add tests batch 20
This commit is contained in:
@@ -9,7 +9,7 @@ class SemesterRangeService
|
||||
{
|
||||
public function normalizeSemester(?string $semester): string
|
||||
{
|
||||
$value = strtolower(trim((string) $semester));
|
||||
$value = strtolower(trim((string)$semester));
|
||||
|
||||
return match ($value) {
|
||||
'fall', 'autumn' => 'Fall',
|
||||
@@ -76,7 +76,7 @@ class SemesterRangeService
|
||||
protected function parseSchoolYear(string $schoolYear): array
|
||||
{
|
||||
if (preg_match('/^\s*(\d{4})\s*-\s*(\d{4})\s*$/', $schoolYear, $m)) {
|
||||
return [(int) $m[1], (int) $m[2]];
|
||||
return [(int)$m[1], (int)$m[2]];
|
||||
}
|
||||
|
||||
$configured = trim((string) Configuration::getConfig('school_year'));
|
||||
@@ -85,7 +85,7 @@ class SemesterRangeService
|
||||
}
|
||||
|
||||
$year = (int) date('Y');
|
||||
$derived = $year.'-'.($year + 1);
|
||||
$derived = $year . '-' . ($year + 1);
|
||||
Configuration::setConfigValueByKey('school_year', $derived);
|
||||
|
||||
return [$year, $year + 1];
|
||||
|
||||
Reference in New Issue
Block a user