public function getCourse() { if (!isset($_SESSION)) { session_start(); } $lms = strtoupper($_SESSION['lms']); if (Lms::isValidValue($lms)) { switch ($lms) { case Lms::CANVAS: $canvasHelper = new CanvasHelper(); return json_decode($canvasHelper->getCourse()); default: $canvasHelper = new CanvasHelper(); return json_decode($canvasHelper->getCourse()); } } else { throw new \Exception("Invalid LMS"); } }