container = $container; } /** * @param $type * @return ReservationServiceInterface * @throws \Interop\Container\Exception\ContainerException */ public function get($type) { switch ($type) { case (Entities::APPOINTMENT): /** @var ReservationServiceInterface $appointmentReservationService */ $appointmentReservationService = $this->container->get('application.reservation.appointment.service'); return $appointmentReservationService; case (Entities::EVENT): /** @var ReservationServiceInterface $eventReservationService */ $eventReservationService = $this->container->get('application.reservation.event.service'); return $eventReservationService; } } }