private function isNotInteropMiddleware($handler, RequestInterface $request)
{
if ($handler instanceof ServerMiddlewareInterface) {
return false;
}
if (!$this->responsePrototype) {
throw new Exception\MissingResponsePrototypeException('Invoking callable middleware following http-interop middleware, ' . 'but no response prototype is present; please inject one in your ' . 'MiddlewarePipe or ensure Stratigility callable middleware exists ' . 'in the outer layer of your application.');
}
if (!$request instanceof ServerRequestInterface) {
throw new Exception\InvalidRequestTypeException('Invoking callable middleware following http-interop middleware, ' . 'but a server request was not provided.');
}
return true;
}