Skip to content

Commit

Permalink
🚑️: Fix empty rooms and usless classes
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPLukaas committed Mar 15, 2024
1 parent e522621 commit 74f6704
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/src/Service/ClassesScraperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ public function scrapeClasses(): array
$classes[] = $classGroup;
});

return $this->removeUslessClasses($classes);
}

private function removeUslessClasses(array $classes): array
{
$uselessClasses = ['TSST -', 'CPI2 Groupe 3 INT', 'CQPM -'];
foreach ($classes as $key => $class) {
if (in_array($class->getName(), $uselessClasses)) {
unset($classes[$key]);
}
}

return $classes;
}
}
1 change: 1 addition & 0 deletions backend/src/Service/TimetableService.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function parseData(array $parsedData): array
$creneaux = $this->defineCreneaux();
$weeks = [];


foreach ($parsedData['GROUPE']['PLAGES']['SEMAINE'] as $week) {
$weekSchedule = new WeekSchedule();
$weekSchedule->setId($week['SemId']);
Expand Down

0 comments on commit 74f6704

Please sign in to comment.