kbsali / php-redmine-api

A simple PHP Redmine API client, Object Oriented

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add method `UnexpectedResponseException::getResponse()`

Art4 opened this issue · comments

In v2.4.0 we've introduced the UnexpectedResponseException if the Redmine server delivers an unexpected response. Since #357 we have a Response interface.

I propose to add a new method to the UnexpectedResponseException to get the response.

public static function create(Response $response, $previous = null): self
public function getResponse(): ?Response

Requiring a Response would be a breaking change, so getResponse() could also return null. There also might be cases were we won't have the Response.