private function makeMethodNotAllowedResponse(array $methods, Request $request): Promise {
        return call(function () use ($methods, $request) {
            /** @var \Amp\Http\Server\Response $response */
            $response = yield $this->errorHandler->handleError(Status::METHOD_NOT_ALLOWED, null, $request);
            $response->setHeader("allow", \implode(", ", $methods));
            return $response;
        });
    }
private function makeMethodNotAllowedResponse(array $methods, Request $request): Promise {
        return call(function () use ($methods, $request) {
            /** @var \Amp\Http\Server\Response $response */
            $response = yield $this->errorHandler->handleError(Status::METHOD_NOT_ALLOWED, null, $request);
            $response->setHeader("allow", \implode(", ", $methods));
            return $response;
        });
    }
private function makeMethodNotAllowedResponse ( array $ methods , Request $ request ) : Promise { return call ( function ( ) use ( $ methods , $ request ) { /** @var \Amp\Http\Server\Response $response */ $ response = yield $ this -> errorHandler -> handleError ( Status :: METHOD_NOT_ALLOWED , null , $ request ) ; $ response -> setHeader ( "allow" , \ implode ( ", " , $ methods ) ) ; return $ response ; } ) ; }
Create a response if the requested method is not allowed for the matched path.

@param string[] $methods
@param Request $request

@return Promise<\Amp\Http\Server\Response>
Create a response if the requested method is not allowed for the matched path .