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: CHANGELOG.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
### Added
11
11
12
+
- New class `Redmine\Serializer\PathSerializer` to build an URL path with query parameters.
13
+
- New class `Redmine\Serializer\JsonSerializer` to encode or normalize JSON data.
14
+
- New class `Redmine\Serializer\XmlSerializer` to encode or normalize XML data.
12
15
- Allow `Psr\Http\Message\RequestFactoryInterface` as Argument #2 ($requestFactory) in `Redmine\Client\Psr18Client::__construct()`
13
16
- Added support for PHP 8.2
14
17
15
18
### Deprecated
16
19
17
20
- Providing Argument #2 ($requestFactory) in `Redmine\Client\Psr18Client::__construct()` as type `Psr\Http\Message\ServerRequestFactoryInterface` is deprecated, provide as type `Psr\Http\Message\RequestFactoryInterface` instead
18
-
-`Redmine\Api\AbstractApi::attachCustomFieldXML()` is deprecated
19
-
-`Redmine\Api\Project::prepareParamsXml()` is deprecated
21
+
-`Redmine\Api\AbstractApi::attachCustomFieldXML()` is deprecated, use `Redmine\Serializer\XmlSerializer::createFromArray()` instead
22
+
-`Redmine\Api\Project::prepareParamsXml()` is deprecated, use `Redmine\Serializer\XmlSerializer::createFromArray()` instead
Copy file name to clipboardExpand all lines: docs/usage.md
+101-1Lines changed: 101 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,7 +217,9 @@ try {
217
217
218
218
## API
219
219
220
-
You can now use the `getApi()` method to create and get a specific Redmine API.
220
+
### Mid-level API
221
+
222
+
You can now use the `getApi()` method to create and get a specific Redmine API. This simplifies common use-cases and gives you some features like caching and assigning a user to an issue by username instead of the user ID.
221
223
222
224
To check for failed requests you can afterwards check the status code via `$client->getLastResponseStatusCode()`.
*:x:*Issue Relations - only partially implemented*
568
+
*:heavy_check_mark: Issue Statuses
569
+
*:heavy_check_mark: News
570
+
*:heavy_check_mark: Projects
571
+
*:heavy_check_mark: Project Memberships
572
+
*:heavy_check_mark: Queries
573
+
*:heavy_check_mark: Roles
574
+
*:heavy_check_mark: Time Entries
575
+
*:heavy_check_mark: Time Entry Activities
576
+
*:heavy_check_mark: Trackers
577
+
*:heavy_check_mark: Users
578
+
*:heavy_check_mark: Versions
579
+
*:heavy_check_mark: Wiki
580
+
581
+
If some features are missing in `getApi()` you are welcome to create a PR. Besides, it is always possible to use the low-level API.
582
+
583
+
### Low-level API
584
+
585
+
The low-level API allows you to send highly customized requests to the Redmine server.
586
+
587
+
> :bulb: See the [Redmine REST-API docs](https://www.redmine.org/projects/redmine/wiki/Rest_api) for available endpoints and required parameters.
588
+
589
+
The client has 4 methods for requests:
590
+
591
+
-`requestGet()`
592
+
-`requestPost()`
593
+
-`requestPut()`
594
+
-`requestDelete()`
595
+
596
+
Using this methods you can use every Redmine API endpoint. The following example shows you how to rename a project and add a custom field. To build the XML body you can use the `XmlSerializer`.
Copy file name to clipboardExpand all lines: src/Redmine/Api/AbstractApi.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -32,12 +32,12 @@ public function __construct(Client $client)
32
32
*
33
33
* @return bool
34
34
*
35
-
* @deprecated This method does not correctly handle 2xx codes that are not 200 or 201, use \Redmine\Client\Client::getLastResponseStatusCode() instead
35
+
* @deprecated since v2.1.0, because it does not correctly handle 2xx codes that are not 200 or 201, use \Redmine\Client\Client::getLastResponseStatusCode() instead
36
36
* @see Client::getLastResponseStatusCode() for checking the status code directly
37
37
*/
38
38
publicfunctionlastCallFailed()
39
39
{
40
-
@trigger_error('The '.__METHOD__.' method is deprecated, use \Redmine\Client\Client::getLastResponseStatusCode() instead.', E_USER_DEPRECATED);
40
+
@trigger_error('`'.__METHOD__.'()` is deprecated since v2.1.0, use \Redmine\Client\Client::getLastResponseStatusCode() instead.', E_USER_DEPRECATED);
@trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED);
267
+
@trigger_error('`'.__METHOD__.'()` is deprecated since v2.3.0, use `\Redmine\Serializer\XmlSerializer::createFromArray()` instead.', E_USER_DEPRECATED);
Copy file name to clipboardExpand all lines: src/Redmine/Api/Project.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -156,15 +156,15 @@ public function update($id, array $params)
156
156
}
157
157
158
158
/**
159
-
* @deprecated the `prepareParamsXml()` method is deprecated, use `\Redmine\Serializer\XmlSerializer::createFromArray()` instead.
159
+
* @deprecated since v2.3.0, use `\Redmine\Serializer\XmlSerializer::createFromArray()` instead.
160
160
*
161
161
* @param array $params
162
162
*
163
163
* @return \SimpleXMLElement
164
164
*/
165
165
protectedfunctionprepareParamsXml($params)
166
166
{
167
-
@trigger_error('The '.__METHOD__.' method is deprecated, use `\Redmine\Serializer\XmlSerializer::createFromArray()` instead.', E_USER_DEPRECATED);
167
+
@trigger_error('`'.__METHOD__.'()` is deprecated since v2.3.0, use `\Redmine\Serializer\XmlSerializer::createFromArray()` instead.', E_USER_DEPRECATED);
0 commit comments