diff --git a/src/API/CourseProviderInterface.php b/src/API/CourseProviderInterface.php index ee946fcdae79860435ec901b9be3b7a7597205ab..b08634d29ffc278719c98017cc38399b3282a4ae 100644 --- a/src/API/CourseProviderInterface.php +++ b/src/API/CourseProviderInterface.php @@ -6,28 +6,40 @@ namespace Dbp\Relay\BaseCourseBundle\API; use Dbp\Relay\BaseCourseBundle\Entity\Course; use Dbp\Relay\BaseCourseBundle\Entity\CourseAttendee; +use Dbp\Relay\CoreBundle\Exception\ApiError; interface CourseProviderInterface { - public function getCourseById(string $identifier, array $options = []): ?Course; + /** + * @throws ApiError + */ + public function getCourseById(string $identifier, array $options = []): Course; /** * @return Course[] + * + * @throws ApiError */ public function getCourses(array $options = []): array; /** * @return Course[] + * + * @throws ApiError */ public function getCoursesByOrganization(string $orgUnitId, array $options = []): array; /** * @return Course[] + * + * @throws ApiError */ public function getCoursesByLecturer(string $lecturerId, array $options = []): array; /** * @return CourseAttendee[] + * + * @throws ApiError */ public function getAttendeesByCourse(string $courseId, array $options = []): array; } diff --git a/src/Service/DummyCourseProvider.php b/src/Service/DummyCourseProvider.php index f5683fe05622b96c13e39bc74dc592df5ea9fab9..2de0a9dad1661ec1c794be3a5d3f982a04045926 100644 --- a/src/Service/DummyCourseProvider.php +++ b/src/Service/DummyCourseProvider.php @@ -10,7 +10,7 @@ use Dbp\Relay\BaseCourseBundle\Entity\CourseAttendee; class DummyCourseProvider implements CourseProviderInterface { - public function getCourseById(string $identifier, array $options = []): ?Course + public function getCourseById(string $identifier, array $options = []): Course { $course = new Course(); $course->setIdentifier($identifier);