File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,8 @@ $client->stopImpersonateUser();
199
199
200
200
You can now use the ` getApi() ` method to create and get a specific Redmine API.
201
201
202
+ To check for failed requests you can afterwards check the status code via ` $client->getLastResponseStatusCode() ` .
203
+
202
204
``` php
203
205
// ----------------------------
204
206
// Trackers
Original file line number Diff line number Diff line change @@ -28,9 +28,14 @@ public function __construct(Client $client)
28
28
* Returns whether or not the last api call failed.
29
29
*
30
30
* @return bool
31
+ *
32
+ * @deprecated This method does not correctly handle 2xx codes that are not 200 or 201, use \Redmine\Client\Client::getLastResponseStatusCode() instead
33
+ * @see Client::getLastResponseStatusCode() for checking the status code directly
31
34
*/
32
35
public function lastCallFailed ()
33
36
{
37
+ @trigger_error ('The ' .__METHOD__ .' method is deprecated, use ' .Client::class.'::getLastResponseStatusCode() instead. ' , E_USER_DEPRECATED );
38
+
34
39
$ code = $ this ->client ->getLastResponseStatusCode ();
35
40
36
41
return 200 !== $ code && 201 !== $ code ;
You can’t perform that action at this time.
0 commit comments