You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/migrate-to-psr18client.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Since `php-redmine-api` v1.7.0 there is a new PSR-18 based client `Redmine\Clien
6
6
7
7
With the new interface `Redmine\Client\Client` there are now standarized methods for all clients. The new `Redmine\Client\Psr18Client` and the current `Redmine\Client` implementing this interface.
8
8
9
-
### api() to getApi()
9
+
### `api()` -> `getApi()`
10
10
11
11
Search in your code for the usage of `$client->api('issue')` and the magic getter like `$client->issue`. Then replace this calls with `$client->getApi('issue')`.
12
12
@@ -18,7 +18,7 @@ Search in your code for the usage of `$client->api('issue')` and the magic gette
18
18
+$client->getApi('issue')->create($data);
19
19
```
20
20
21
-
### getResponseCode() to getLastResponseStatusCode()
Replace every call for `$client->getResponseCode()` with `$client->getLastResponseStatusCode()`.
24
24
@@ -30,7 +30,7 @@ Replace every call for `$client->getResponseCode()` with `$client->getLastRespon
30
30
}
31
31
```
32
32
33
-
### get() to requestGet()
33
+
### `get()` -> `requestGet()`
34
34
35
35
If you are using `$client->get()`, `$client->post()`, `$client->put()` or `$client->delete()` directly you will have to change your code. This methods parse a possible JSON or XML response but in future the parsing of the raw response body will be up to you.
36
36
@@ -59,7 +59,7 @@ This example shows how you can parse the response body of a GET request.
59
59
+}
60
60
```
61
61
62
-
### post() to requestPost()
62
+
### `post()` -> `requestPost()`
63
63
64
64
This example shows how you can parse the response body of a POST request.
65
65
@@ -78,7 +78,7 @@ This example shows how you can parse the response body of a POST request.
78
78
+}
79
79
```
80
80
81
-
### put() to requestPut()
81
+
### `put()` -> `requestPut()`
82
82
83
83
This example shows how you can parse the response body of a PUT request.
84
84
@@ -97,7 +97,7 @@ This example shows how you can parse the response body of a PUT request.
97
97
+}
98
98
```
99
99
100
-
### delete() to requestDelete()
100
+
### `delete()` -> `requestDelete()`
101
101
102
102
This example shows how you can parse the response body of a DELETE request.
103
103
@@ -107,7 +107,7 @@ This example shows how you can parse the response body of a DELETE request.
If you are using the [Redmine user impersonation](https://www.redmine.org/projects/redmine/wiki/Rest_api#User-Impersonation) you have to change your code.
0 commit comments