/** * Performs negotiation and passes the now decorated request to the next middleware in the queue. * * @param Request $request * @param Response $response * @param callable $next * * @return Response */ public function __invoke(Request $request, Response $response, callable $next) { $newRequest = $this->negotiator->negotiate($request); return $next($newRequest, $response); }
/** * Performs negotiation and passes the now decorated request to the next middleware. * * {@inheritDoc} */ public function __invoke(Request $request, Response $response, callable $out = null) { $modifiedRequest = $this->negotiator->negotiate($request); parent::__invoke($modifiedRequest, $response, $out); }