mailjet / mailjet-apiv3-php

[API v3] Mailjet PHP Wrapper
http://dev.mailjet.com
MIT License
267 stars 86 forks source link

Error creating response in no-call mode #229

Closed Xirdion closed 3 years ago

Xirdion commented 3 years ago

If Client::$call is set to false, I am not able to create a Response.

The Client is calling the method _call() which will create a new Request-object and calls its method call() with Client::$call as parameter. https://github.com/mailjet/mailjet-apiv3-php/blob/v1.5.3/src/Mailjet/Client.php#L316

Within Request::call() method is set to null and then used to create a new Response. https://github.com/mailjet/mailjet-apiv3-php/blob/v1.5.3/src/Mailjet/Request.php#L152

If false === $call: image

But the constructor of Response expects argument 2 to be a Psr\Http\Message\ResponseInterface! https://github.com/mailjet/mailjet-apiv3-php/blob/v1.5.3/src/Mailjet/Response.php#L49

image

So I am not able to create the response object.

Pavlico commented 3 years ago

@Xirdion Thank you for contributing, it was valid point :)