- Introduced a new private property
lastRequest
of typeServerRequestInterface
to store the last processed request. - Implemented the
RequestHandlerInterface
to adhere to the standardized request handling protocol.
- Modified the constructor to include the
ResponseInterface $response
andarray $stack
parameters. - The
handle
method now assigns the incoming request to thelastRequest
property before processing the middlewares stack. - Inside the
handle
method, the response generated by the middlewares stack is now assigned to a local variable$response
before being returned. - Added a new public method
getLastRequest
to retrieve the last processed request. It returns aServerRequestInterface|null
, representing the last request ornull
if no request has been processed.
These changes enhance the RequestHandler
class by providing the ability to track and retrieve the last processed request through the getLastRequest
method. Additionally, the implementation of the RequestHandlerInterface
ensures compatibility with standardized request handling practices.