responseFactory = $responseFactory; $this->streamFactory = $streamFactory; } public function serverRequestAction(ServerRequestInterface $request): ResponseInterface { return $this->responseFactory ->createResponse() ->withBody($this->streamFactory->createStream(sprintf('%s', $request->getMethod()))); } public function requestAction(RequestInterface $request): ResponseInterface { return $this->responseFactory ->createResponse() ->withStatus(403) ->withBody($this->streamFactory->createStream(sprintf('%s %s', $request->getMethod(), $request->getBody()->getContents()))); } public function messageAction(MessageInterface $request): ResponseInterface { return $this->responseFactory ->createResponse() ->withStatus(422) ->withBody($this->streamFactory->createStream(sprintf('%s', $request->getHeader('X-My-Header')[0]))); } }