Skip to content

Commit 8630bf8

Browse files
authored
Merge pull request #282 from Art4/backport-279-to-v1-branch
Backport #279 to v1.x
2 parents 3dfe50f + 145130f commit 8630bf8

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
- `AbstractApi::get()` returns `null` on empty response body instead of `false` for BC reasons
13+
- Use uppercase in HTTP verbs
1314

1415
## [v1.8.0](https://github.com/kbsali/php-redmine-api/compare/v1.7.0...v1.8.0) - 2021-04-19
1516

src/Redmine/Client/Psr18Client.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,31 +70,31 @@ public function stopImpersonateUser(): void
7070
*/
7171
public function requestGet(string $path): bool
7272
{
73-
return $this->runRequest('get', $path);
73+
return $this->runRequest('GET', $path);
7474
}
7575

7676
/**
7777
* Create and send a POST request.
7878
*/
7979
public function requestPost(string $path, string $body): bool
8080
{
81-
return $this->runRequest('post', $path, $body);
81+
return $this->runRequest('POST', $path, $body);
8282
}
8383

8484
/**
8585
* Create and send a PUT request.
8686
*/
8787
public function requestPut(string $path, string $body): bool
8888
{
89-
return $this->runRequest('put', $path, $body);
89+
return $this->runRequest('PUT', $path, $body);
9090
}
9191

9292
/**
9393
* Create and send a DELETE request.
9494
*/
9595
public function requestDelete(string $path): bool
9696
{
97-
return $this->runRequest('delete', $path);
97+
return $this->runRequest('DELETE', $path);
9898
}
9999

100100
/**
@@ -180,7 +180,7 @@ private function createRequest(string $method, string $path, string $body = ''):
180180
}
181181

182182
switch ($method) {
183-
case 'post':
183+
case 'POST':
184184
if ($this->isUploadCall($path, $body)) {
185185
$request = $request->withBody(
186186
$this->streamFactory->createStreamFromFile($body)
@@ -191,7 +191,7 @@ private function createRequest(string $method, string $path, string $body = ''):
191191
);
192192
}
193193
break;
194-
case 'put':
194+
case 'PUT':
195195
if ('' !== $body) {
196196
$request = $request->withBody(
197197
$this->streamFactory->createStream($body)

0 commit comments

Comments
 (0)