/** * Constructor. * * @param \YapepBase\Request\HttpRequest $request The request object. Must be a HttpRequest or descendant. * @param \YapepBase\Response\HttpResponse $response The response object. Must be a HttpResponse or descendant. * * @throws \YapepBase\Exception\ControllerException On error. (eg. incompatible request or response object) */ public function __construct(IRequest $request, IResponse $response) { if (!$request instanceof HttpRequest) { throw new ControllerException('The specified request is not a HttpRequest', ControllerException::ERR_INCOMPATIBLE_REQUEST); } if (!$response instanceof HttpResponse) { throw new ControllerException('The specified response is not a HttpResponse', ControllerException::ERR_INCOMPATIBLE_RESPONSE); } parent::__construct($request, $response); }