diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index 28943453..3d1186f5 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -15,6 +15,7 @@
'linebreak_after_opening_tag' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
+ 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'arrays']], // Remove this rule after dropping support for PHP 7.4
])
->setFinder($finder)
->setRiskyAllowed(true)
diff --git a/src/Redmine/Api/AbstractApi.php b/src/Redmine/Api/AbstractApi.php
index 1e4af9e7..934e2811 100644
--- a/src/Redmine/Api/AbstractApi.php
+++ b/src/Redmine/Api/AbstractApi.php
@@ -49,7 +49,7 @@ public function __construct($client)
__METHOD__,
Client::class,
HttpClient::class,
- (is_object($client)) ? get_class($client) : gettype($client)
+ (is_object($client)) ? get_class($client) : gettype($client),
));
}
@@ -117,7 +117,7 @@ protected function get($path, $decodeIfJson = true)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeRequest(
'GET',
strval($path),
- $this->getContentTypeFromPath(strval($path))
+ $this->getContentTypeFromPath(strval($path)),
));
$body = $this->lastResponse->getContent();
@@ -158,7 +158,7 @@ protected function post($path, $data)
'POST',
strval($path),
$this->getContentTypeFromPath(strval($path)),
- $data
+ $data,
));
$body = $this->lastResponse->getContent();
@@ -191,7 +191,7 @@ protected function put($path, $data)
'PUT',
strval($path),
$this->getContentTypeFromPath(strval($path)),
- $data
+ $data,
));
$body = $this->lastResponse->getContent();
@@ -222,7 +222,7 @@ protected function delete($path)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeRequest(
'DELETE',
strval($path),
- $this->getContentTypeFromPath(strval($path))
+ $this->getContentTypeFromPath(strval($path)),
));
return $this->lastResponse->getContent();
@@ -251,7 +251,7 @@ protected function sanitizeParams(array $defaults, array $params)
{
return array_filter(
array_merge($defaults, $params),
- [$this, 'isNotNull']
+ [$this, 'isNotNull'],
);
}
@@ -301,7 +301,7 @@ protected function retrieveData(string $endpoint, array $params = []): array
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeRequest(
'GET',
strval($endpoint),
- $this->getContentTypeFromPath(strval($endpoint))
+ $this->getContentTypeFromPath(strval($endpoint)),
));
return $this->getResponseAsArray($this->lastResponse);
@@ -312,7 +312,7 @@ protected function retrieveData(string $endpoint, array $params = []): array
'limit' => 25,
'offset' => 0,
],
- $params
+ $params,
);
$returnData = [];
@@ -334,7 +334,7 @@ protected function retrieveData(string $endpoint, array $params = []): array
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeRequest(
'GET',
PathSerializer::create($endpoint, $params)->getPath(),
- $this->getContentTypeFromPath($endpoint)
+ $this->getContentTypeFromPath($endpoint),
));
$newDataSet = $this->getResponseAsArray($this->lastResponse);
@@ -457,7 +457,7 @@ public function request(Request $request): Response
return HttpFactory::makeResponse(
$this->client->getLastResponseStatusCode(),
$this->client->getLastResponseContentType(),
- $this->client->getLastResponseBody()
+ $this->client->getLastResponseBody(),
);
}
};
diff --git a/src/Redmine/Api/Attachment.php b/src/Redmine/Api/Attachment.php
index db10fa48..3e030ef4 100644
--- a/src/Redmine/Api/Attachment.php
+++ b/src/Redmine/Api/Attachment.php
@@ -70,7 +70,7 @@ final public function update(int $id, array $params): bool
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeJsonRequest(
'PUT',
'/attachments/' . $id . '.json',
- JsonSerializer::createFromArray(['attachment' => $params])->getEncoded()
+ JsonSerializer::createFromArray(['attachment' => $params])->getEncoded(),
));
if ($this->lastResponse->getStatusCode() !== 204) {
@@ -91,7 +91,7 @@ public function download($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeRequest(
'GET',
- '/attachments/download/' . urlencode(strval($id))
+ '/attachments/download/' . urlencode(strval($id)),
));
if (200 !== $this->lastResponse->getStatusCode()) {
@@ -119,7 +119,7 @@ public function upload($attachment, $params = [])
'POST',
PathSerializer::create('/uploads.json', $params)->getPath(),
'application/octet-stream',
- $attachment
+ $attachment,
));
return $this->lastResponse->getContent();
@@ -138,7 +138,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/attachments/' . urlencode(strval($id)) . '.xml'
+ '/attachments/' . urlencode(strval($id)) . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/Group.php b/src/Redmine/Api/Group.php
index e532d64a..e8cd0bae 100644
--- a/src/Redmine/Api/Group.php
+++ b/src/Redmine/Api/Group.php
@@ -151,7 +151,7 @@ public function create(array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/groups.xml',
- XmlSerializer::createFromArray(['group' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['group' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -185,7 +185,7 @@ public function update(int $id, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/groups/' . $id . '.xml',
- XmlSerializer::createFromArray(['group' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['group' => $params])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -207,7 +207,7 @@ public function show($id, array $params = [])
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeJsonRequest(
'GET',
- PathSerializer::create('/groups/' . urlencode(strval($id)) . '.json', $params)->getPath()
+ PathSerializer::create('/groups/' . urlencode(strval($id)) . '.json', $params)->getPath(),
));
$body = $this->lastResponse->getContent();
@@ -236,7 +236,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/groups/' . $id . '.xml'
+ '/groups/' . $id . '.xml',
));
return $this->lastResponse->getContent();
@@ -257,7 +257,7 @@ public function addUser($id, $userId)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/groups/' . $id . '/users.xml',
- XmlSerializer::createFromArray(['user_id' => $userId])->getEncoded()
+ XmlSerializer::createFromArray(['user_id' => $userId])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -283,7 +283,7 @@ public function removeUser($id, $userId)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/groups/' . $id . '/users/' . $userId . '.xml'
+ '/groups/' . $id . '/users/' . $userId . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/Issue.php b/src/Redmine/Api/Issue.php
index 6e67d27e..1c98dceb 100644
--- a/src/Redmine/Api/Issue.php
+++ b/src/Redmine/Api/Issue.php
@@ -163,7 +163,7 @@ public function show($id, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeJsonRequest(
'GET',
- PathSerializer::create('/issues/' . urlencode(strval($id)) . '.json', $params)->getPath()
+ PathSerializer::create('/issues/' . urlencode(strval($id)) . '.json', $params)->getPath(),
));
$body = $this->lastResponse->getContent();
@@ -217,7 +217,7 @@ public function create(array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/issues.xml',
- XmlSerializer::createFromArray(['issue' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['issue' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -263,7 +263,7 @@ public function update($id, array $params)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/issues/' . urlencode(strval($id)) . '.xml',
- XmlSerializer::createFromArray(['issue' => $sanitizedParams])->getEncoded()
+ XmlSerializer::createFromArray(['issue' => $sanitizedParams])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -280,7 +280,7 @@ public function addWatcher($id, $watcherUserId)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/issues/' . urlencode(strval($id)) . '/watchers.xml',
- XmlSerializer::createFromArray(['user_id' => urlencode(strval($watcherUserId))])->getEncoded()
+ XmlSerializer::createFromArray(['user_id' => urlencode(strval($watcherUserId))])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -302,7 +302,7 @@ public function removeWatcher($id, $watcherUserId)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/issues/' . urlencode(strval($id)) . '/watchers/' . urlencode(strval($watcherUserId)) . '.xml'
+ '/issues/' . urlencode(strval($id)) . '/watchers/' . urlencode(strval($watcherUserId)) . '.xml',
));
return $this->lastResponse->getContent();
@@ -428,7 +428,7 @@ public function attachMany($id, array $attachments)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeJsonRequest(
'PUT',
'/issues/' . urlencode(strval($id)) . '.json',
- JsonSerializer::createFromArray(['issue' => $params])->getEncoded()
+ JsonSerializer::createFromArray(['issue' => $params])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -445,7 +445,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/issues/' . urlencode(strval($id)) . '.xml'
+ '/issues/' . urlencode(strval($id)) . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/IssueCategory.php b/src/Redmine/Api/IssueCategory.php
index f0856cb6..864040d8 100644
--- a/src/Redmine/Api/IssueCategory.php
+++ b/src/Redmine/Api/IssueCategory.php
@@ -42,7 +42,7 @@ final public function listByProject($projectIdentifier, array $params = []): arr
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidParameterException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
@@ -182,7 +182,7 @@ public function create($project, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/projects/' . $project . '/issue_categories.xml',
- XmlSerializer::createFromArray(['issue_category' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['issue_category' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -214,7 +214,7 @@ public function update($id, array $params)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/issue_categories/' . urlencode(strval($id)) . '.xml',
- XmlSerializer::createFromArray(['issue_category' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['issue_category' => $params])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -236,7 +236,7 @@ public function remove($id, array $params = [])
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- PathSerializer::create('/issue_categories/' . urlencode(strval($id)) . '.xml', $params)->getPath()
+ PathSerializer::create('/issue_categories/' . urlencode(strval($id)) . '.xml', $params)->getPath(),
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/IssueRelation.php b/src/Redmine/Api/IssueRelation.php
index 8fa299bf..d7529a87 100644
--- a/src/Redmine/Api/IssueRelation.php
+++ b/src/Redmine/Api/IssueRelation.php
@@ -124,7 +124,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/relations/' . $id . '.xml'
+ '/relations/' . $id . '.xml',
));
return $this->lastResponse->getContent();
@@ -164,7 +164,7 @@ public function create($issueId, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeJsonRequest(
'POST',
'/issues/' . urlencode(strval($issueId)) . '/relations.json',
- JsonSerializer::createFromArray(['relation' => $params])->getEncoded()
+ JsonSerializer::createFromArray(['relation' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/Membership.php b/src/Redmine/Api/Membership.php
index 73a00cd0..15f25618 100644
--- a/src/Redmine/Api/Membership.php
+++ b/src/Redmine/Api/Membership.php
@@ -40,7 +40,7 @@ final public function listByProject($projectIdentifier, array $params = []): arr
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidParameterException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
@@ -112,7 +112,7 @@ public function create($project, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/projects/' . $project . '/memberships.xml',
- XmlSerializer::createFromArray(['membership' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['membership' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -150,7 +150,7 @@ public function update($id, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/memberships/' . $id . '.xml',
- XmlSerializer::createFromArray(['membership' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['membership' => $params])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -169,7 +169,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/memberships/' . $id . '.xml'
+ '/memberships/' . $id . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/News.php b/src/Redmine/Api/News.php
index d6b30419..ffde4da4 100644
--- a/src/Redmine/Api/News.php
+++ b/src/Redmine/Api/News.php
@@ -34,7 +34,7 @@ final public function listByProject($projectIdentifier, array $params = []): arr
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidParameterException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
diff --git a/src/Redmine/Api/Project.php b/src/Redmine/Api/Project.php
index 593d3ed4..2b5aaa3d 100755
--- a/src/Redmine/Api/Project.php
+++ b/src/Redmine/Api/Project.php
@@ -138,7 +138,7 @@ public function show($id, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeJsonRequest(
'GET',
- PathSerializer::create('/projects/' . urlencode(strval($id)) . '.json', $params)->getPath()
+ PathSerializer::create('/projects/' . urlencode(strval($id)) . '.json', $params)->getPath(),
));
$body = $this->lastResponse->getContent();
@@ -184,7 +184,7 @@ public function create(array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/projects.xml',
- XmlSerializer::createFromArray(['project' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['project' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -218,7 +218,7 @@ public function update($id, array $params)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/projects/' . urlencode(strval($id)) . '.xml',
- XmlSerializer::createFromArray(['project' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['project' => $params])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -241,14 +241,14 @@ final public function close($projectIdentifier): bool
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidArgumentException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/projects/' . strval($projectIdentifier) . '/close.xml',
- ''
+ '',
));
$lastResponse = $this->getLastResponse();
@@ -277,14 +277,14 @@ final public function reopen($projectIdentifier): bool
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidArgumentException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/projects/' . strval($projectIdentifier) . '/reopen.xml',
- ''
+ '',
));
$lastResponse = $this->getLastResponse();
@@ -313,14 +313,14 @@ final public function archive($projectIdentifier): bool
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidArgumentException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/projects/' . strval($projectIdentifier) . '/archive.xml',
- ''
+ '',
));
$lastResponse = $this->getLastResponse();
@@ -349,14 +349,14 @@ final public function unarchive($projectIdentifier): bool
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidArgumentException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/projects/' . strval($projectIdentifier) . '/unarchive.xml',
- ''
+ '',
));
$lastResponse = $this->getLastResponse();
@@ -381,7 +381,7 @@ protected function prepareParamsXml($params)
@trigger_error('`' . __METHOD__ . '()` is deprecated since v2.3.0, use `\Redmine\Serializer\XmlSerializer::createFromArray()` instead.', E_USER_DEPRECATED);
return new SimpleXMLElement(
- XmlSerializer::createFromArray(['project' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['project' => $params])->getEncoded(),
);
}
@@ -398,7 +398,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/projects/' . $id . '.xml'
+ '/projects/' . $id . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/Role.php b/src/Redmine/Api/Role.php
index 668b0bb7..b70c1e53 100644
--- a/src/Redmine/Api/Role.php
+++ b/src/Redmine/Api/Role.php
@@ -105,7 +105,7 @@ public function show($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeJsonRequest(
'GET',
- '/roles/' . urlencode(strval($id)) . '.json'
+ '/roles/' . urlencode(strval($id)) . '.json',
));
$body = $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/TimeEntry.php b/src/Redmine/Api/TimeEntry.php
index 71e7b4e7..d419b34b 100644
--- a/src/Redmine/Api/TimeEntry.php
+++ b/src/Redmine/Api/TimeEntry.php
@@ -88,7 +88,7 @@ public function show($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeJsonRequest(
'GET',
- '/time_entries/' . urlencode(strval($id)) . '.json'
+ '/time_entries/' . urlencode(strval($id)) . '.json',
));
$body = $this->lastResponse->getContent();
@@ -137,7 +137,7 @@ public function create(array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/time_entries.xml',
- XmlSerializer::createFromArray(['time_entry' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['time_entry' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -174,7 +174,7 @@ public function update($id, array $params)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/time_entries/' . $id . '.xml',
- XmlSerializer::createFromArray(['time_entry' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['time_entry' => $params])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -193,7 +193,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/time_entries/' . $id . '.xml'
+ '/time_entries/' . $id . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/User.php b/src/Redmine/Api/User.php
index 354798f7..aa93cfe1 100644
--- a/src/Redmine/Api/User.php
+++ b/src/Redmine/Api/User.php
@@ -157,8 +157,8 @@ public function show($id, array $params = [])
[
'memberships',
'groups',
- ]
- )
+ ],
+ ),
);
$params['include'] = implode(',', $params['include']);
@@ -214,7 +214,7 @@ public function create(array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/users.xml',
- XmlSerializer::createFromArray(['user' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['user' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -250,7 +250,7 @@ public function update($id, array $params)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/users/' . urlencode(strval($id)) . '.xml',
- XmlSerializer::createFromArray(['user' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['user' => $params])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -269,7 +269,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/users/' . $id . '.xml'
+ '/users/' . $id . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/Version.php b/src/Redmine/Api/Version.php
index 270b8a21..518d3cb0 100644
--- a/src/Redmine/Api/Version.php
+++ b/src/Redmine/Api/Version.php
@@ -40,7 +40,7 @@ final public function listByProject($projectIdentifier, array $params = []): arr
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidParameterException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
@@ -190,7 +190,7 @@ public function create($project, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'POST',
'/projects/' . $project . '/versions.xml',
- XmlSerializer::createFromArray(['version' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['version' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -227,7 +227,7 @@ public function update($id, array $params)
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/versions/' . $id . '.xml',
- XmlSerializer::createFromArray(['version' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['version' => $params])->getEncoded(),
));
return $this->lastResponse->getContent();
@@ -272,7 +272,7 @@ public function remove($id)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/versions/' . $id . '.xml'
+ '/versions/' . $id . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Api/Wiki.php b/src/Redmine/Api/Wiki.php
index a5670bcf..b24700a3 100644
--- a/src/Redmine/Api/Wiki.php
+++ b/src/Redmine/Api/Wiki.php
@@ -40,7 +40,7 @@ final public function listByProject($projectIdentifier, array $params = []): arr
if (! is_int($projectIdentifier) && ! is_string($projectIdentifier)) {
throw new InvalidParameterException(sprintf(
'%s(): Argument #1 ($projectIdentifier) must be of type int or string',
- __METHOD__
+ __METHOD__,
));
}
@@ -148,7 +148,7 @@ public function create($project, $page, array $params = [])
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'PUT',
'/projects/' . $project . '/wiki/' . urlencode($page) . '.xml',
- XmlSerializer::createFromArray(['wiki_page' => $params])->getEncoded()
+ XmlSerializer::createFromArray(['wiki_page' => $params])->getEncoded(),
));
$body = $this->lastResponse->getContent();
@@ -190,7 +190,7 @@ public function remove($project, $page)
{
$this->lastResponse = $this->getHttpClient()->request(HttpFactory::makeXmlRequest(
'DELETE',
- '/projects/' . $project . '/wiki/' . urlencode($page) . '.xml'
+ '/projects/' . $project . '/wiki/' . urlencode($page) . '.xml',
));
return $this->lastResponse->getContent();
diff --git a/src/Redmine/Client/NativeCurlClient.php b/src/Redmine/Client/NativeCurlClient.php
index f22e40ce..7b89ea77 100644
--- a/src/Redmine/Client/NativeCurlClient.php
+++ b/src/Redmine/Client/NativeCurlClient.php
@@ -70,13 +70,13 @@ public function request(Request $request): Response
$request->getMethod(),
$request->getPath(),
$request->getContent(),
- $request->getContentType()
+ $request->getContentType(),
);
return HttpFactory::makeResponse(
$this->lastResponseStatusCode,
$this->lastResponseContentType,
- $this->lastResponseBody
+ $this->lastResponseBody,
);
}
diff --git a/src/Redmine/Client/Psr18Client.php b/src/Redmine/Client/Psr18Client.php
index e83806ab..f5048759 100644
--- a/src/Redmine/Client/Psr18Client.php
+++ b/src/Redmine/Client/Psr18Client.php
@@ -53,9 +53,9 @@ public function __construct(
'%s(): Providing Argument #2 ($requestFactory) as %s is deprecated since v2.3.0, please provide as %s instead.',
__METHOD__,
ServerRequestFactoryInterface::class,
- RequestFactoryInterface::class
+ RequestFactoryInterface::class,
),
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$requestFactory = $this->handleServerRequestFactory($requestFactory);
@@ -65,7 +65,7 @@ public function __construct(
throw new Exception(sprintf(
'%s(): Argument #2 ($requestFactory) must be of type %s',
__METHOD__,
- RequestFactoryInterface::class
+ RequestFactoryInterface::class,
));
}
@@ -88,13 +88,13 @@ public function request(Request $request): Response
$request->getMethod(),
$request->getPath(),
$request->getContent(),
- $request->getContentType()
+ $request->getContentType(),
);
return HttpFactory::makeResponse(
$response->getStatusCode(),
$response->getHeaderLine('Content-Type'),
- strval($response->getBody())
+ strval($response->getBody()),
);
}
@@ -231,7 +231,7 @@ private function createRequest(string $method, string $path, string $body = '',
{
$request = $this->requestFactory->createRequest(
$method,
- $this->url . $path
+ $this->url . $path,
);
// Set Authentication header
@@ -239,7 +239,7 @@ private function createRequest(string $method, string $path, string $body = '',
if (null !== $this->password) {
$request = $request->withHeader(
'Authorization',
- 'Basic ' . base64_encode($this->apikeyOrUsername . ':' . $this->password)
+ 'Basic ' . base64_encode($this->apikeyOrUsername . ':' . $this->password),
);
} else {
$request = $request->withHeader('X-Redmine-API-Key', $this->apikeyOrUsername);
@@ -257,18 +257,18 @@ private function createRequest(string $method, string $path, string $body = '',
@trigger_error('Uploading an attachment by filepath is deprecated since v2.1.0, use file_get_contents() to upload the file content instead.', E_USER_DEPRECATED);
$request = $request->withBody(
- $this->streamFactory->createStreamFromFile($body)
+ $this->streamFactory->createStreamFromFile($body),
);
} elseif ('' !== $body) {
$request = $request->withBody(
- $this->streamFactory->createStream($body)
+ $this->streamFactory->createStream($body),
);
}
break;
case 'PUT':
if ('' !== $body) {
$request = $request->withBody(
- $this->streamFactory->createStream($body)
+ $this->streamFactory->createStream($body),
);
}
break;
diff --git a/src/Redmine/Exception/UnexpectedResponseException.php b/src/Redmine/Exception/UnexpectedResponseException.php
index c2de6af5..1eb693c2 100644
--- a/src/Redmine/Exception/UnexpectedResponseException.php
+++ b/src/Redmine/Exception/UnexpectedResponseException.php
@@ -26,7 +26,7 @@ public static function create(Response $response, Throwable $prev = null): self
$e = new self(
'The Redmine server replied with an unexpected response.',
($prev !== null) ? $prev->getCode() : 1,
- $prev
+ $prev,
);
$e->response = $response;
diff --git a/src/Redmine/Serializer/JsonSerializer.php b/src/Redmine/Serializer/JsonSerializer.php
index 86c64f6e..b91f5342 100644
--- a/src/Redmine/Serializer/JsonSerializer.php
+++ b/src/Redmine/Serializer/JsonSerializer.php
@@ -70,7 +70,7 @@ private function decode(string $encoded): void
$encoded,
true,
512,
- \JSON_THROW_ON_ERROR
+ \JSON_THROW_ON_ERROR,
);
} catch (JsonException $e) {
throw new SerializerException('Catched error "' . $e->getMessage() . '" while decoding JSON: ' . $encoded, $e->getCode(), $e);
@@ -85,13 +85,13 @@ private function encode(array $normalized): void
$this->encoded = json_encode(
$normalized,
\JSON_THROW_ON_ERROR,
- 512
+ 512,
);
} catch (JsonException $e) {
throw new SerializerException(
'Could not encode JSON from array: ' . $e->getMessage(),
$e->getCode(),
- $e
+ $e,
);
}
}
diff --git a/src/Redmine/Serializer/XmlSerializer.php b/src/Redmine/Serializer/XmlSerializer.php
index f46b47ad..c8e9ed17 100644
--- a/src/Redmine/Serializer/XmlSerializer.php
+++ b/src/Redmine/Serializer/XmlSerializer.php
@@ -85,7 +85,7 @@ private function deserialize(string $encoded): void
throw new SerializerException(
'Catched errors: "' . implode('", "', $errors) . '" while decoding XML: ' . $encoded,
$e->getCode(),
- $e
+ $e,
);
} finally {
libxml_use_internal_errors($prevSetting);
@@ -127,7 +127,7 @@ private function denormalize(array $normalized): void
throw new SerializerException(
'Could not create XML from array: "' . implode('", "', $errors) . '"',
$e->getCode(),
- $e
+ $e,
);
} finally {
libxml_use_internal_errors($prevSetting);
diff --git a/tests/Behat/Bootstrap/AttachmentContextTrait.php b/tests/Behat/Bootstrap/AttachmentContextTrait.php
index fd3ef650..02a5ea33 100644
--- a/tests/Behat/Bootstrap/AttachmentContextTrait.php
+++ b/tests/Behat/Bootstrap/AttachmentContextTrait.php
@@ -27,7 +27,7 @@ public function iUploadTheContentOfTheFileWithTheFollowingData(string $filepath,
$this->registerClientResponse(
$api->upload(file_get_contents($filepath), $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -47,7 +47,7 @@ public function iUpdateTheAttachmentWithTheIdWithTheFollowingData(int $attachmen
$this->registerClientResponse(
$api->update($attachmentId, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -61,7 +61,7 @@ public function iShowTheAttachmentWithTheId(int $attachmentId)
$this->registerClientResponse(
$api->show($attachmentId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -75,7 +75,7 @@ public function iDownloadTheAttachmentWithTheId(int $attachmentId)
$this->registerClientResponse(
$api->download($attachmentId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -89,7 +89,7 @@ public function iRemoveTheAttachmentWithTheId($attachmentId)
$this->registerClientResponse(
$api->remove($attachmentId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/FeatureContext.php b/tests/Behat/Bootstrap/FeatureContext.php
index d72ed4eb..79977857 100644
--- a/tests/Behat/Bootstrap/FeatureContext.php
+++ b/tests/Behat/Bootstrap/FeatureContext.php
@@ -101,7 +101,7 @@ public function iHaveAClient($clientName)
$this->client = new NativeCurlClient(
$this->redmine->getRedmineUrl(),
- $this->redmine->getApiKey()
+ $this->redmine->getApiKey(),
);
}
@@ -125,7 +125,7 @@ public function theResponseHasTheStatusCode(int $statusCode)
$this->assertSame(
$statusCode,
$this->lastResponse->getStatusCode(),
- 'Raw response content: ' . $this->lastResponse->getContent()
+ 'Raw response content: ' . $this->lastResponse->getContent(),
);
}
@@ -137,7 +137,7 @@ public function theResponseHasTheContentType(string $contentType)
$this->assertStringStartsWith(
$contentType,
$this->lastResponse->getContentType(),
- 'Raw response content: ' . $this->lastResponse->getContent()
+ 'Raw response content: ' . $this->lastResponse->getContent(),
);
}
diff --git a/tests/Behat/Bootstrap/GroupContextTrait.php b/tests/Behat/Bootstrap/GroupContextTrait.php
index c7933101..e9d05a26 100644
--- a/tests/Behat/Bootstrap/GroupContextTrait.php
+++ b/tests/Behat/Bootstrap/GroupContextTrait.php
@@ -39,7 +39,7 @@ public function iCreateAGroupWithTheFollowingData(TableNode $table)
$this->registerClientResponse(
$api->create($data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -53,7 +53,7 @@ public function iListAllGroups()
$this->registerClientResponse(
$api->list(),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -67,7 +67,7 @@ public function iListTheNamesOfAllGroups()
$this->registerClientResponse(
$api->listNames(),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -81,7 +81,7 @@ public function iShowTheGroupWithId(int $groupId)
$this->registerClientResponse(
$api->show($groupId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -101,7 +101,7 @@ public function iUpdateTheGroupWithIdWithTheFollowingData(int $groupId, TableNod
$this->registerClientResponse(
$api->update($groupId, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -115,7 +115,7 @@ public function iAddTheUserWithIdToTheGroupWithId($userId, $groupId)
$this->registerClientResponse(
$api->addUser($groupId, $userId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -129,7 +129,7 @@ public function iRemoveTheUserWithIdFromTheGroupWithId($userId, $groupId)
$this->registerClientResponse(
$api->removeUser($groupId, $userId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -143,7 +143,7 @@ public function iRemoveTheGroupWithId($groupId)
$this->registerClientResponse(
$api->remove($groupId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/IssueCategoryContextTrait.php b/tests/Behat/Bootstrap/IssueCategoryContextTrait.php
index 2d4259b0..7352e1d8 100644
--- a/tests/Behat/Bootstrap/IssueCategoryContextTrait.php
+++ b/tests/Behat/Bootstrap/IssueCategoryContextTrait.php
@@ -25,7 +25,7 @@ public function iCreateAnIssueCategoryForProjectIdentifierAndWithTheFollowingDat
$this->registerClientResponse(
$api->create($identifier, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -45,7 +45,7 @@ public function iUpdateTheIssueCategoryWithIdAndTheFollowingData($id, TableNode
$this->registerClientResponse(
$api->update($id, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -59,7 +59,7 @@ public function iRemoveTheIssueCategoryWithId($id)
$this->registerClientResponse(
$api->remove($id),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/IssueContextTrait.php b/tests/Behat/Bootstrap/IssueContextTrait.php
index f748be58..4a2e146b 100644
--- a/tests/Behat/Bootstrap/IssueContextTrait.php
+++ b/tests/Behat/Bootstrap/IssueContextTrait.php
@@ -26,7 +26,7 @@ public function iCreateAnIssueWithTheFollowingData(TableNode $table)
$this->registerClientResponse(
$api->create($data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -46,7 +46,7 @@ public function iUpdateTheIssueWithIdAndTheFollowingData($issueId, TableNode $ta
$this->registerClientResponse(
$api->update($issueId, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -60,7 +60,7 @@ public function iShowTheIssueWithId($issueId)
$this->registerClientResponse(
$api->show($issueId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -74,7 +74,7 @@ public function iAddTheUserIdAsAWatcherToTheIssueWithId($userId, $issueId)
$this->registerClientResponse(
$api->addWatcher($issueId, $userId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -88,7 +88,7 @@ public function iRemoveTheUserIdAsAWatcherFromTheIssueWithId($userId, $issueId)
$this->registerClientResponse(
$api->removeWatcher($issueId, $userId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -102,7 +102,7 @@ public function iRemoveTheIssueWithId($issueId)
$this->registerClientResponse(
$api->remove($issueId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/IssueRelationContextTrait.php b/tests/Behat/Bootstrap/IssueRelationContextTrait.php
index 4d994023..9feab31e 100644
--- a/tests/Behat/Bootstrap/IssueRelationContextTrait.php
+++ b/tests/Behat/Bootstrap/IssueRelationContextTrait.php
@@ -25,7 +25,7 @@ public function iCreateAnIssueRelationForIssueIdWithTheFollowingData(int $issueI
$this->registerClientResponse(
$api->create($issueId, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -39,7 +39,7 @@ public function iDeleteTheIssueRelationWithTheId($relationId)
$this->registerClientResponse(
$api->remove($relationId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/MembershipContextTrait.php b/tests/Behat/Bootstrap/MembershipContextTrait.php
index 103854e1..d1a5242f 100644
--- a/tests/Behat/Bootstrap/MembershipContextTrait.php
+++ b/tests/Behat/Bootstrap/MembershipContextTrait.php
@@ -29,7 +29,7 @@ public function iCreateAMembershipToProjectWithIdentifierAndTheFollowingData($id
$this->registerClientResponse(
$api->create($identifier, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -53,7 +53,7 @@ public function iUpdateTheMembershipWithIdAndTheFollowingData($id, TableNode $ta
$this->registerClientResponse(
$api->update($id, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -67,7 +67,7 @@ public function iRemoveTheMembershipWithId($id)
$this->registerClientResponse(
$api->remove($id),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -81,7 +81,7 @@ public function iRemoveTheUserWithIdFromTheProjectWithIdentifier($userId, $ident
$this->registerClientResponse(
$api->removeMember($identifier, (int) $userId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/ProjectContextTrait.php b/tests/Behat/Bootstrap/ProjectContextTrait.php
index 91a47674..789f4556 100644
--- a/tests/Behat/Bootstrap/ProjectContextTrait.php
+++ b/tests/Behat/Bootstrap/ProjectContextTrait.php
@@ -39,7 +39,7 @@ public function iCreateAProjectWithTheFollowingData(TableNode $table)
$this->registerClientResponse(
$api->create($data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -53,7 +53,7 @@ public function iListAllProjects()
$this->registerClientResponse(
$api->list(),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -67,7 +67,7 @@ public function iShowTheProjectWithIdentifier(string $identifier)
$this->registerClientResponse(
$api->show($identifier),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -87,7 +87,7 @@ public function iUpdateTheProjectWithIdentifierWithTheFollowingData(string $iden
$this->registerClientResponse(
$api->update($identifier, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -101,7 +101,7 @@ public function iCloseTheProjectWithIdentifier(string $identifier)
$this->registerClientResponse(
$api->close($identifier),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -115,7 +115,7 @@ public function iReopenTheProjectWithIdentifier(string $identifier)
$this->registerClientResponse(
$api->reopen($identifier),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -129,7 +129,7 @@ public function iArchiveTheProjectWithIdentifier(string $identifier)
$this->registerClientResponse(
$api->archive($identifier),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -143,7 +143,7 @@ public function iUnarchiveTheProjectWithIdentifier(string $identifier)
$this->registerClientResponse(
$api->unarchive($identifier),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -157,7 +157,7 @@ public function iRemoveTheProjectWithIdentifier($identifier)
$this->registerClientResponse(
$api->remove($identifier),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/TimeEntryContextTrait.php b/tests/Behat/Bootstrap/TimeEntryContextTrait.php
index 89d2830c..05980ced 100644
--- a/tests/Behat/Bootstrap/TimeEntryContextTrait.php
+++ b/tests/Behat/Bootstrap/TimeEntryContextTrait.php
@@ -25,7 +25,7 @@ public function iCreateATimeEntryWithTheFollowingData(TableNode $table)
$this->registerClientResponse(
$api->create($data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -45,7 +45,7 @@ public function iUpdateTheTimeEntryWithIdAndTheFollowingData($id, TableNode $tab
$this->registerClientResponse(
$api->update($id, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -59,7 +59,7 @@ public function iShowTheTimeEntryWithTheId(int $activityId)
$this->registerClientResponse(
$api->show($activityId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -73,7 +73,7 @@ public function iRemoveTheTimeEntryWithId($activityId)
$this->registerClientResponse(
$api->remove($activityId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/UserContextTrait.php b/tests/Behat/Bootstrap/UserContextTrait.php
index 6ee2b8f0..f6b55458 100644
--- a/tests/Behat/Bootstrap/UserContextTrait.php
+++ b/tests/Behat/Bootstrap/UserContextTrait.php
@@ -25,7 +25,7 @@ public function iCreateAUserWithTheFollowingData(TableNode $table)
$this->registerClientResponse(
$api->create($data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -45,7 +45,7 @@ public function iUpdateTheUserWithIdAndTheFollowingData($id, TableNode $table)
$this->registerClientResponse(
$api->update($id, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -59,7 +59,7 @@ public function iShowTheUserWithId(int $userId)
$this->registerClientResponse(
$api->show($userId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -73,7 +73,7 @@ public function iRemoveTheUserWithId($userId)
$this->registerClientResponse(
$api->remove($userId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/VersionContextTrait.php b/tests/Behat/Bootstrap/VersionContextTrait.php
index 64f8d0ff..13c9d9ba 100644
--- a/tests/Behat/Bootstrap/VersionContextTrait.php
+++ b/tests/Behat/Bootstrap/VersionContextTrait.php
@@ -20,7 +20,7 @@ public function iCreateAVersionWithNameAndProjectIdentifier(string $versionName,
new TableNode([
['property', 'value'],
['name', $versionName],
- ])
+ ]),
);
}
@@ -40,7 +40,7 @@ public function iCreateAVersionWithProjectIdentifierAndWithTheFollowingData(stri
$this->registerClientResponse(
$api->create($identifier, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -60,7 +60,7 @@ public function iUpdateTheVersionWithIdAndTheFollowingData($id, TableNode $table
$this->registerClientResponse(
$api->update($id, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -74,7 +74,7 @@ public function iShowTheVersionWithId(int $versionId)
$this->registerClientResponse(
$api->show($versionId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -88,7 +88,7 @@ public function iRemoveTheVersionWithId($versionId)
$this->registerClientResponse(
$api->remove($versionId),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
}
diff --git a/tests/Behat/Bootstrap/WikiContextTrait.php b/tests/Behat/Bootstrap/WikiContextTrait.php
index 28ad478f..ab278df2 100644
--- a/tests/Behat/Bootstrap/WikiContextTrait.php
+++ b/tests/Behat/Bootstrap/WikiContextTrait.php
@@ -18,7 +18,7 @@ public function iCreateAWikiPageWithNameAndProjectIdentifier(string $pageName, s
$this->iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData(
$pageName,
$identifier,
- new TableNode([['property', 'value']])
+ new TableNode([['property', 'value']]),
);
}
@@ -34,7 +34,7 @@ public function iCreateAWikiPageWithNameAndProjectIdentifierWithTheFollowingData
$this->registerClientResponse(
$api->create($identifier, $pageName, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -48,7 +48,7 @@ public function iShowTheWikiPageWithNameAndProjectIdentifier(string $pageName, s
$this->registerClientResponse(
$api->show($identifier, $pageName),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -64,7 +64,7 @@ public function iUpdateTheWikiPageWithNameAndProjectIdentifierWithTheFollowingDa
$this->registerClientResponse(
$api->update($identifier, $pageName, $data),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
@@ -78,7 +78,7 @@ public function iRemoveTheWikiPageWithNameAndProjectIdentifier($pageName, $ident
$this->registerClientResponse(
$api->remove($identifier, $pageName),
- $api->getLastResponse()
+ $api->getLastResponse(),
);
}
diff --git a/tests/Fixtures/AssertingHttpClient.php b/tests/Fixtures/AssertingHttpClient.php
index c6fb6ebc..90cf7d3e 100644
--- a/tests/Fixtures/AssertingHttpClient.php
+++ b/tests/Fixtures/AssertingHttpClient.php
@@ -80,7 +80,7 @@ public function request(Request $request): Response
'Mssing request data for Request "%s %s" with Content-Type "%s".',
$request->getMethod(),
$request->getPath(),
- $request->getContentType()
+ $request->getContentType(),
));
}
diff --git a/tests/Integration/Psr18ClientRequestGenerationTest.php b/tests/Integration/Psr18ClientRequestGenerationTest.php
index 885605b1..e084c623 100644
--- a/tests/Integration/Psr18ClientRequestGenerationTest.php
+++ b/tests/Integration/Psr18ClientRequestGenerationTest.php
@@ -51,7 +51,7 @@ public function testPsr18ClientCreatesCorrectRequests(
'%s %s HTTP/%s',
$request->getMethod(),
$request->getUri()->__toString(),
- $request->getProtocolVersion()
+ $request->getProtocolVersion(),
);
$fullRequest = $statusLine . \PHP_EOL .
@@ -92,7 +92,7 @@ public function createStreamFromResource($resource): StreamInterface
$streamFactory,
$url,
$apikeyOrUsername,
- $pwd
+ $pwd,
);
if (null !== $impersonateUser) {
diff --git a/tests/Unit/Api/AbstractApi/DeleteTest.php b/tests/Unit/Api/AbstractApi/DeleteTest.php
index 8c77dc05..a3136e4a 100644
--- a/tests/Unit/Api/AbstractApi/DeleteTest.php
+++ b/tests/Unit/Api/AbstractApi/DeleteTest.php
@@ -26,8 +26,8 @@ public function testDeleteWithHttpClient()
'',
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
$api = new class ($client) extends AbstractApi {};
diff --git a/tests/Unit/Api/AbstractApi/GetTest.php b/tests/Unit/Api/AbstractApi/GetTest.php
index 7e260143..211e62cb 100644
--- a/tests/Unit/Api/AbstractApi/GetTest.php
+++ b/tests/Unit/Api/AbstractApi/GetTest.php
@@ -27,8 +27,8 @@ public function testGetWithHttpClient()
'',
200,
'application/json',
- '{"foo_bar": 12345}'
- ]
+ '{"foo_bar": 12345}',
+ ],
);
$api = new class ($client) extends AbstractApi {};
@@ -39,7 +39,7 @@ public function testGetWithHttpClient()
// Perform the tests
$this->assertSame(
['foo_bar' => 12345],
- $method->invoke($api, 'path.json')
+ $method->invoke($api, 'path.json'),
);
}
diff --git a/tests/Unit/Api/AbstractApi/PostTest.php b/tests/Unit/Api/AbstractApi/PostTest.php
index 4a2e6545..0d25fb96 100644
--- a/tests/Unit/Api/AbstractApi/PostTest.php
+++ b/tests/Unit/Api/AbstractApi/PostTest.php
@@ -27,8 +27,8 @@ public function testPostWithHttpClient()
'',
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
$api = new class ($client) extends AbstractApi {};
diff --git a/tests/Unit/Api/AbstractApi/PutTest.php b/tests/Unit/Api/AbstractApi/PutTest.php
index a8709b1b..ff78c11e 100644
--- a/tests/Unit/Api/AbstractApi/PutTest.php
+++ b/tests/Unit/Api/AbstractApi/PutTest.php
@@ -27,8 +27,8 @@ public function testPutWithHttpClient()
'',
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
$api = new class ($client) extends AbstractApi {};
diff --git a/tests/Unit/Api/AbstractApiTest.php b/tests/Unit/Api/AbstractApiTest.php
index 6fd1fea0..6d8c75c0 100644
--- a/tests/Unit/Api/AbstractApiTest.php
+++ b/tests/Unit/Api/AbstractApiTest.php
@@ -67,13 +67,13 @@ public function runGet($path)
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\AbstractApi::get()` is deprecated since v2.6.0, use `\Redmine\Http\HttpClient::request()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->runGet('/path.json');
@@ -104,13 +104,13 @@ public function runPost($path, $data)
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\AbstractApi::post()` is deprecated since v2.6.0, use `\Redmine\Http\HttpClient::request()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->runPost('/path.json', 'data');
@@ -132,13 +132,13 @@ public function runPut($path, $data)
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\AbstractApi::put()` is deprecated since v2.6.0, use `\Redmine\Http\HttpClient::request()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->runPut('/path.json', 'data');
@@ -160,13 +160,13 @@ public function runDelete($path)
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\AbstractApi::delete()` is deprecated since v2.6.0, use `\Redmine\Http\HttpClient::request()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->runDelete('/path.json');
@@ -219,15 +219,15 @@ public function testLastCallFailedPreventsRaceCondition()
'200.json',
'application/json',
'',
- 200
+ 200,
],
[
'GET',
'500.json',
'application/json',
'',
- 500
- ]
+ 500,
+ ],
);
$api1 = new class ($client) extends AbstractApi {
diff --git a/tests/Unit/Api/Attachment/DownloadTest.php b/tests/Unit/Api/Attachment/DownloadTest.php
index 2814c6e3..eab6a69e 100644
--- a/tests/Unit/Api/Attachment/DownloadTest.php
+++ b/tests/Unit/Api/Attachment/DownloadTest.php
@@ -26,8 +26,8 @@ public function testDownloadReturnsCorrectResponse($id, $expectedPath, $response
'',
$responseCode,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Attachment/RemoveTest.php b/tests/Unit/Api/Attachment/RemoveTest.php
index 307f2e84..4009fa7b 100644
--- a/tests/Unit/Api/Attachment/RemoveTest.php
+++ b/tests/Unit/Api/Attachment/RemoveTest.php
@@ -23,8 +23,8 @@ public function testRemoveReturnsString()
'',
204,
'',
- ''
- ]
+ '',
+ ],
);
$api = new Attachment($client);
diff --git a/tests/Unit/Api/Attachment/ShowTest.php b/tests/Unit/Api/Attachment/ShowTest.php
index 0249335e..d47c73b5 100644
--- a/tests/Unit/Api/Attachment/ShowTest.php
+++ b/tests/Unit/Api/Attachment/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($id, $expectedPath, $response, $e
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Attachment/UpdateTest.php b/tests/Unit/Api/Attachment/UpdateTest.php
index df6c43b1..96b9728d 100644
--- a/tests/Unit/Api/Attachment/UpdateTest.php
+++ b/tests/Unit/Api/Attachment/UpdateTest.php
@@ -27,8 +27,8 @@ public function testUpdateReturnsCorrectResponse($id, array $params, $expectedPa
$expectedContent,
204,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
@@ -66,7 +66,7 @@ public function testUpdateThrowsUnexpectedResponseException()
403,
'',
'',
- ]
+ ],
);
$api = new Attachment($client);
diff --git a/tests/Unit/Api/Attachment/UploadTest.php b/tests/Unit/Api/Attachment/UploadTest.php
index 2816610a..5bfe5378 100644
--- a/tests/Unit/Api/Attachment/UploadTest.php
+++ b/tests/Unit/Api/Attachment/UploadTest.php
@@ -26,8 +26,8 @@ public function testUploadReturnsCorrectResponse($attachment, $params, $expected
$expectedAttachment,
$responseCode,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -61,7 +61,7 @@ public static function getUploadData(): array
'test attachment with params' => [
'attachment-content',
[
- 'filename' => 'testfile.txt'
+ 'filename' => 'testfile.txt',
],
'attachment-content',
'/uploads.json?filename=testfile.txt',
@@ -72,7 +72,7 @@ public static function getUploadData(): array
'test attachment with filepath' => [
'/path/to/testfile_01.txt',
[
- 'filename' => 'testfile.txt'
+ 'filename' => 'testfile.txt',
],
'/path/to/testfile_01.txt',
'/uploads.json?filename=testfile.txt',
diff --git a/tests/Unit/Api/CustomField/ListTest.php b/tests/Unit/Api/CustomField/ListTest.php
index 60803fb1..a5da8fce 100644
--- a/tests/Unit/Api/CustomField/ListTest.php
+++ b/tests/Unit/Api/CustomField/ListTest.php
@@ -79,7 +79,7 @@ public function testListWithHighLimitParametersReturnsResponse()
$client->expects($this->exactly(3))
->method('requestGet')
->with(
- $this->stringStartsWith('/custom_fields.json')
+ $this->stringStartsWith('/custom_fields.json'),
)
->willReturn(true);
$client->expects($this->exactly(3))
@@ -113,7 +113,7 @@ public function testListCallsEndpointUntilOffsetIsHigherThanTotalCount()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/custom_fields.json')
+ $this->stringStartsWith('/custom_fields.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/CustomFieldTest.php b/tests/Unit/Api/CustomFieldTest.php
index 0aec8702..b360c0cb 100644
--- a/tests/Unit/Api/CustomFieldTest.php
+++ b/tests/Unit/Api/CustomFieldTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\CustomField::all()` is deprecated since v2.4.0, use `Redmine\Api\CustomField::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -91,7 +91,7 @@ public function testAllReturnsClientGetResponseWithParameters()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringContains('not-used')
+ $this->stringContains('not-used'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -126,7 +126,7 @@ public function testAllReturnsClientGetResponseWithHighLimit()
$client->expects($this->exactly(3))
->method('requestGet')
->with(
- $this->stringStartsWith('/custom_fields.json')
+ $this->stringStartsWith('/custom_fields.json'),
)
->willReturn(true);
$client->expects($this->exactly(3))
@@ -163,7 +163,7 @@ public function testAllCallsEndpointUntilOffsetIsHigherThanTotalCount()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/custom_fields.json')
+ $this->stringStartsWith('/custom_fields.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -200,7 +200,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/custom_fields.json')
+ $this->stringStartsWith('/custom_fields.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -234,7 +234,7 @@ public function testListingCallsGetOnlyTheFirstTime()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/custom_fields.json')
+ $this->stringStartsWith('/custom_fields.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -269,7 +269,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/custom_fields.json')
+ $this->stringStartsWith('/custom_fields.json'),
)
->willReturn(true);
$client->expects($this->exactly(2))
@@ -300,7 +300,7 @@ public function testGetIdByNameMakesGetRequest()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/custom_fields.json')
+ $this->stringStartsWith('/custom_fields.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/Group/AddUserTest.php b/tests/Unit/Api/Group/AddUserTest.php
index 62306e21..400af20f 100644
--- a/tests/Unit/Api/Group/AddUserTest.php
+++ b/tests/Unit/Api/Group/AddUserTest.php
@@ -27,8 +27,8 @@ public function testAddUserReturnsCorrectResponse($groupId, $userId, $expectedPa
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -69,8 +69,8 @@ public function testAddUserReturnsEmptyString()
'2',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Group/CreateTest.php b/tests/Unit/Api/Group/CreateTest.php
index 1c853c2b..65898abc 100644
--- a/tests/Unit/Api/Group/CreateTest.php
+++ b/tests/Unit/Api/Group/CreateTest.php
@@ -31,8 +31,8 @@ public function testCreateReturnsCorrectResponse($parameters, $expectedPath, $ex
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -118,8 +118,8 @@ public function testCreateReturnsEmptyString()
'Group Name',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Group/ListNamesTest.php b/tests/Unit/Api/Group/ListNamesTest.php
index 68197a2b..39829d98 100644
--- a/tests/Unit/Api/Group/ListNamesTest.php
+++ b/tests/Unit/Api/Group/ListNamesTest.php
@@ -29,7 +29,7 @@ public function testListNamesReturnsCorrectResponse($expectedPath, $responseCode
$responseCode,
'application/json',
$response,
- ]
+ ],
);
// Create the object under test
@@ -50,7 +50,7 @@ public static function getListNamesData(): array
"groups": []
}
JSON,
- []
+ [],
],
'test with multiple groups' => [
'/groups.json',
@@ -68,7 +68,7 @@ public static function getListNamesData(): array
9 => "Group 1",
8 => "Group 2",
7 => "Group 3",
- ]
+ ],
],
];
}
@@ -94,7 +94,7 @@ public function testListNamesCallsHttpClientOnlyOnce()
]
}
JSON,
- ]
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Group/RemoveTest.php b/tests/Unit/Api/Group/RemoveTest.php
index 8598d5a7..1a1851a2 100644
--- a/tests/Unit/Api/Group/RemoveTest.php
+++ b/tests/Unit/Api/Group/RemoveTest.php
@@ -23,8 +23,8 @@ public function testRemoveReturnsString()
'',
204,
'',
- ''
- ]
+ '',
+ ],
);
$api = new Group($client);
diff --git a/tests/Unit/Api/Group/RemoveUserTest.php b/tests/Unit/Api/Group/RemoveUserTest.php
index ee22bdf7..fe73f361 100644
--- a/tests/Unit/Api/Group/RemoveUserTest.php
+++ b/tests/Unit/Api/Group/RemoveUserTest.php
@@ -23,8 +23,8 @@ public function testRemoveUserReturnsString()
'',
204,
'',
- ''
- ]
+ '',
+ ],
);
$api = new Group($client);
diff --git a/tests/Unit/Api/Group/ShowTest.php b/tests/Unit/Api/Group/ShowTest.php
index c2c50d95..5bb23fd8 100644
--- a/tests/Unit/Api/Group/ShowTest.php
+++ b/tests/Unit/Api/Group/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($groupId, array $params, $expecte
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Group/UpdateTest.php b/tests/Unit/Api/Group/UpdateTest.php
index eb4bfd57..d8847dbe 100644
--- a/tests/Unit/Api/Group/UpdateTest.php
+++ b/tests/Unit/Api/Group/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $parameters, $expectedPath
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/GroupTest.php b/tests/Unit/Api/GroupTest.php
index ffb9252f..211d8064 100644
--- a/tests/Unit/Api/GroupTest.php
+++ b/tests/Unit/Api/GroupTest.php
@@ -29,13 +29,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Group::all()` is deprecated since v2.4.0, use `Redmine\Api\Group::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -95,8 +95,8 @@ public function testAllReturnsClientGetResponseWithParameters()
->with(
$this->logicalAnd(
$this->stringStartsWith('/groups.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -133,13 +133,13 @@ public function testListingTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Group::listing()` is deprecated since v2.7.0, use `Redmine\Api\Group::listNames()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->listing();
@@ -162,7 +162,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/groups.json')
+ $this->stringStartsWith('/groups.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -196,7 +196,7 @@ public function testListingCallsGetOnlyTheFirstTime()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/groups.json')
+ $this->stringStartsWith('/groups.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -231,7 +231,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/groups.json')
+ $this->stringStartsWith('/groups.json'),
)
->willReturn(true);
$client->expects($this->exactly(2))
diff --git a/tests/Unit/Api/Issue/AddNoteToIssueTest.php b/tests/Unit/Api/Issue/AddNoteToIssueTest.php
index 3d9f0af8..7932f6d3 100644
--- a/tests/Unit/Api/Issue/AddNoteToIssueTest.php
+++ b/tests/Unit/Api/Issue/AddNoteToIssueTest.php
@@ -28,8 +28,8 @@ public function testAddNoteToIssueReturnsCorrectResponse($id, $note, $isPrivate,
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Issue/AddWatcherTest.php b/tests/Unit/Api/Issue/AddWatcherTest.php
index 449907ba..0f51cd2f 100644
--- a/tests/Unit/Api/Issue/AddWatcherTest.php
+++ b/tests/Unit/Api/Issue/AddWatcherTest.php
@@ -27,8 +27,8 @@ public function testAddWatcherReturnsCorrectResponse($issueId, $watcherUserId, $
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -69,8 +69,8 @@ public function testAddWatcherReturnsEmptyString()
'2',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Issue/AttachManyTest.php b/tests/Unit/Api/Issue/AttachManyTest.php
index 9a0bfd41..1c77a767 100644
--- a/tests/Unit/Api/Issue/AttachManyTest.php
+++ b/tests/Unit/Api/Issue/AttachManyTest.php
@@ -26,8 +26,8 @@ public function testAttachManyReturnsCorrectResponse($issueId, $parameters, $exp
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// AttachMany the object under test
diff --git a/tests/Unit/Api/Issue/AttachTest.php b/tests/Unit/Api/Issue/AttachTest.php
index 4e216640..51263987 100644
--- a/tests/Unit/Api/Issue/AttachTest.php
+++ b/tests/Unit/Api/Issue/AttachTest.php
@@ -26,8 +26,8 @@ public function testAttachReturnsCorrectResponse($issueId, $parameters, $expecte
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Attach the object under test
diff --git a/tests/Unit/Api/Issue/CreateTest.php b/tests/Unit/Api/Issue/CreateTest.php
index 1cca0bd0..f3f2d12c 100644
--- a/tests/Unit/Api/Issue/CreateTest.php
+++ b/tests/Unit/Api/Issue/CreateTest.php
@@ -27,8 +27,8 @@ public function testCreateReturnsCorrectResponse($parameters, $expectedPath, $ex
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -243,8 +243,8 @@ public function testCreateReturnsEmptyString()
'',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
@@ -267,7 +267,7 @@ public function testCreateWithHttpClientRetrievesIssueStatusId()
'',
200,
'application/json',
- '{"issue_statuses":[{"name":"Status Name","id":123}]}'
+ '{"issue_statuses":[{"name":"Status Name","id":123}]}',
],
[
'POST',
@@ -276,8 +276,8 @@ public function testCreateWithHttpClientRetrievesIssueStatusId()
'123',
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
@@ -304,7 +304,7 @@ public function testCreateWithHttpClientRetrievesProjectId()
'',
200,
'application/json',
- '{"projects":[{"name":"Project Name","id":3}]}'
+ '{"projects":[{"name":"Project Name","id":3}]}',
],
[
'POST',
@@ -313,8 +313,8 @@ public function testCreateWithHttpClientRetrievesProjectId()
'3',
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
@@ -341,7 +341,7 @@ public function testCreateWithHttpClientRetrievesIssueCategoryId()
'',
200,
'application/json',
- '{"issue_categories":[{"name":"Category Name","id":45}]}'
+ '{"issue_categories":[{"name":"Category Name","id":45}]}',
],
[
'POST',
@@ -350,8 +350,8 @@ public function testCreateWithHttpClientRetrievesIssueCategoryId()
'345',
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
@@ -378,7 +378,7 @@ public function testCreateWithHttpClientRetrievesTrackerId()
'',
200,
'application/json',
- '{"trackers":[{"name":"Tracker Name","id":9}]}'
+ '{"trackers":[{"name":"Tracker Name","id":9}]}',
],
[
'POST',
@@ -387,8 +387,8 @@ public function testCreateWithHttpClientRetrievesTrackerId()
'9',
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
@@ -415,7 +415,7 @@ public function testCreateWithHttpClientRetrievesUserId()
'',
200,
'application/json',
- '{"users":[{"login":"Author Name","id":5},{"login":"Assigned to User Name","id":6}]}'
+ '{"users":[{"login":"Author Name","id":5},{"login":"Assigned to User Name","id":6}]}',
],
[
'POST',
@@ -424,8 +424,8 @@ public function testCreateWithHttpClientRetrievesUserId()
'65',
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
@@ -455,7 +455,7 @@ public function testCreateWithClientCleansParameters()
'',
200,
'application/json',
- '{"projects":[{"name":"Project Name","id":3}]}'
+ '{"projects":[{"name":"Project Name","id":3}]}',
],
[
'GET',
@@ -464,7 +464,7 @@ public function testCreateWithClientCleansParameters()
'',
200,
'application/json',
- '{"issue_categories":[{"name":"Category Name","id":45}]}'
+ '{"issue_categories":[{"name":"Category Name","id":45}]}',
],
[
'GET',
@@ -473,7 +473,7 @@ public function testCreateWithClientCleansParameters()
'',
200,
'application/json',
- '{"issue_statuses":[{"name":"Status Name","id":123}]}'
+ '{"issue_statuses":[{"name":"Status Name","id":123}]}',
],
[
'GET',
@@ -482,7 +482,7 @@ public function testCreateWithClientCleansParameters()
'',
200,
'application/json',
- '{"trackers":[{"name":"Tracker Name","id":9}]}'
+ '{"trackers":[{"name":"Tracker Name","id":9}]}',
],
[
'GET',
@@ -491,7 +491,7 @@ public function testCreateWithClientCleansParameters()
'',
200,
'application/json',
- '{"users":[{"login":"Author Name","id":5},{"login":"Assigned to User Name","id":6}]}'
+ '{"users":[{"login":"Author Name","id":5},{"login":"Assigned to User Name","id":6}]}',
],
[
'POST',
@@ -510,8 +510,8 @@ public function testCreateWithClientCleansParameters()
XML,
200,
'application/xml',
- ''
- ]
+ '',
+ ],
);
$parameters = [
diff --git a/tests/Unit/Api/Issue/RemoveTest.php b/tests/Unit/Api/Issue/RemoveTest.php
index 2dc7d473..e57a24f5 100644
--- a/tests/Unit/Api/Issue/RemoveTest.php
+++ b/tests/Unit/Api/Issue/RemoveTest.php
@@ -26,8 +26,8 @@ public function testRemoveReturnsCorrectResponse($issueId, $expectedPath, $respo
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Issue/RemoveWatcherTest.php b/tests/Unit/Api/Issue/RemoveWatcherTest.php
index 632b168f..9124aa2e 100644
--- a/tests/Unit/Api/Issue/RemoveWatcherTest.php
+++ b/tests/Unit/Api/Issue/RemoveWatcherTest.php
@@ -26,8 +26,8 @@ public function testRemoveWatcherReturnsCorrectResponse($issueId, $watcherUserId
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Issue/SetIssueStatusTest.php b/tests/Unit/Api/Issue/SetIssueStatusTest.php
index d15e9e52..96d55bc6 100644
--- a/tests/Unit/Api/Issue/SetIssueStatusTest.php
+++ b/tests/Unit/Api/Issue/SetIssueStatusTest.php
@@ -21,7 +21,7 @@ public function testSetIssueStatusReturnsCorrectResponse()
'',
200,
'application/json',
- '{"issue_statuses":[{"name":"Status Name","id":123}]}'
+ '{"issue_statuses":[{"name":"Status Name","id":123}]}',
],
[
'PUT',
@@ -30,8 +30,8 @@ public function testSetIssueStatusReturnsCorrectResponse()
'5123',
204,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Issue/ShowTest.php b/tests/Unit/Api/Issue/ShowTest.php
index c9da9e70..2846237f 100644
--- a/tests/Unit/Api/Issue/ShowTest.php
+++ b/tests/Unit/Api/Issue/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($issueId, array $params, $expecte
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Issue/UpdateTest.php b/tests/Unit/Api/Issue/UpdateTest.php
index 3eed07cc..ffdc446c 100644
--- a/tests/Unit/Api/Issue/UpdateTest.php
+++ b/tests/Unit/Api/Issue/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $parameters, $expectedPath
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -124,7 +124,7 @@ public function testUpdateCleansParameters()
'',
200,
'application/json',
- '{"projects":[{"name":"Project Name","id":3}]}'
+ '{"projects":[{"name":"Project Name","id":3}]}',
],
[
'GET',
@@ -133,7 +133,7 @@ public function testUpdateCleansParameters()
'',
200,
'application/json',
- '{"issue_categories":[{"name":"Category Name","id":45}]}'
+ '{"issue_categories":[{"name":"Category Name","id":45}]}',
],
[
'GET',
@@ -142,7 +142,7 @@ public function testUpdateCleansParameters()
'',
200,
'application/json',
- '{"issue_statuses":[{"name":"Status Name","id":123}]}'
+ '{"issue_statuses":[{"name":"Status Name","id":123}]}',
],
[
'GET',
@@ -151,7 +151,7 @@ public function testUpdateCleansParameters()
'',
200,
'application/json',
- '{"trackers":[{"name":"Tracker Name","id":9}]}'
+ '{"trackers":[{"name":"Tracker Name","id":9}]}',
],
[
'GET',
@@ -160,7 +160,7 @@ public function testUpdateCleansParameters()
'',
200,
'application/json',
- '{"users":[{"login":"Author Name","id":5},{"login":"Assigned to User Name","id":6}]}'
+ '{"users":[{"login":"Author Name","id":5},{"login":"Assigned to User Name","id":6}]}',
],
[
'PUT',
@@ -180,8 +180,8 @@ public function testUpdateCleansParameters()
XML,
204,
'',
- ''
- ]
+ '',
+ ],
);
$parameters = [
diff --git a/tests/Unit/Api/IssueCategory/CreateTest.php b/tests/Unit/Api/IssueCategory/CreateTest.php
index b3fce28f..4153f18f 100644
--- a/tests/Unit/Api/IssueCategory/CreateTest.php
+++ b/tests/Unit/Api/IssueCategory/CreateTest.php
@@ -29,8 +29,8 @@ public function testCreateReturnsCorrectResponse($identifier, $parameters, $expe
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -84,8 +84,8 @@ public function testCreateReturnsEmptyString()
'Test Category',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/IssueCategory/RemoveTest.php b/tests/Unit/Api/IssueCategory/RemoveTest.php
index d0392553..6150e240 100644
--- a/tests/Unit/Api/IssueCategory/RemoveTest.php
+++ b/tests/Unit/Api/IssueCategory/RemoveTest.php
@@ -26,8 +26,8 @@ public function testRemoveReturnsCorrectResponse($issueId, $params, $expectedPat
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/IssueCategory/ShowTest.php b/tests/Unit/Api/IssueCategory/ShowTest.php
index 23244d9e..472ba3be 100644
--- a/tests/Unit/Api/IssueCategory/ShowTest.php
+++ b/tests/Unit/Api/IssueCategory/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($id, $expectedPath, $response, $e
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/IssueCategory/UpdateTest.php b/tests/Unit/Api/IssueCategory/UpdateTest.php
index a89f4f3a..3c1f7015 100644
--- a/tests/Unit/Api/IssueCategory/UpdateTest.php
+++ b/tests/Unit/Api/IssueCategory/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $parameters, $expectedPath
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/IssueCategoryTest.php b/tests/Unit/Api/IssueCategoryTest.php
index dd8f47f3..26156bae 100644
--- a/tests/Unit/Api/IssueCategoryTest.php
+++ b/tests/Unit/Api/IssueCategoryTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\IssueCategory::all()` is deprecated since v2.4.0, use `Redmine\Api\IssueCategory::listByProject()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all(5);
@@ -97,8 +97,8 @@ public function testAllReturnsClientGetResponseWithParametersAndProject()
->with(
$this->logicalAnd(
$this->stringStartsWith('/projects/5/issue_categories.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -132,7 +132,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/projects/5/issue_categories')
+ $this->stringStartsWith('/projects/5/issue_categories'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -166,7 +166,7 @@ public function testListingCallsGetOnlyTheFirstTime()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/projects/5/issue_categories')
+ $this->stringStartsWith('/projects/5/issue_categories'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -201,7 +201,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/projects/5/issue_categories')
+ $this->stringStartsWith('/projects/5/issue_categories'),
)
->willReturn(true);
$client->expects($this->exactly(2))
@@ -232,7 +232,7 @@ public function testGetIdByNameMakesGetRequest()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/projects/5/issue_categories.json')
+ $this->stringStartsWith('/projects/5/issue_categories.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/IssuePriorityTest.php b/tests/Unit/Api/IssuePriorityTest.php
index 7a2ea1ee..2ad4ed3c 100644
--- a/tests/Unit/Api/IssuePriorityTest.php
+++ b/tests/Unit/Api/IssuePriorityTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\IssuePriority::all()` is deprecated since v2.4.0, use `Redmine\Api\IssuePriority::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -91,7 +91,7 @@ public function testAllReturnsClientGetResponseWithParameters()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringContains('not-used')
+ $this->stringContains('not-used'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/IssueRelation/CreateTest.php b/tests/Unit/Api/IssueRelation/CreateTest.php
index b59a7645..3adf9327 100644
--- a/tests/Unit/Api/IssueRelation/CreateTest.php
+++ b/tests/Unit/Api/IssueRelation/CreateTest.php
@@ -29,8 +29,8 @@ public function testCreateReturnsCorrectResponse($issueId, $parameters, $expecte
$expectedBody,
$responseCode,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -69,8 +69,8 @@ public function testCreateThrowsExceptionIfResponseContainsEmptyString()
'{"relation":{"issue_to_id":10,"relation_type":"relates"}}',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/IssueRelation/RemoveTest.php b/tests/Unit/Api/IssueRelation/RemoveTest.php
index 7f83a4e4..56cb4373 100644
--- a/tests/Unit/Api/IssueRelation/RemoveTest.php
+++ b/tests/Unit/Api/IssueRelation/RemoveTest.php
@@ -26,8 +26,8 @@ public function testRemoveReturnsCorrectResponse($issueId, $expectedPath, $respo
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/IssueRelation/ShowTest.php b/tests/Unit/Api/IssueRelation/ShowTest.php
index 9c90db84..57065530 100644
--- a/tests/Unit/Api/IssueRelation/ShowTest.php
+++ b/tests/Unit/Api/IssueRelation/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($id, $expectedPath, $response, $e
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/IssueRelationTest.php b/tests/Unit/Api/IssueRelationTest.php
index 36daa0a8..885f4fa1 100644
--- a/tests/Unit/Api/IssueRelationTest.php
+++ b/tests/Unit/Api/IssueRelationTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\IssueRelation::all()` is deprecated since v2.4.0, use `Redmine\Api\IssueRelation::listByIssueId()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all(5);
@@ -93,8 +93,8 @@ public function testAllReturnsClientGetResponseWithParametersAndProject()
->with(
$this->logicalAnd(
$this->stringStartsWith('/issues/5/relations.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/IssueStatusTest.php b/tests/Unit/Api/IssueStatusTest.php
index 767f8b1b..18eeb651 100644
--- a/tests/Unit/Api/IssueStatusTest.php
+++ b/tests/Unit/Api/IssueStatusTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\IssueStatus::all()` is deprecated since v2.4.0, use `Redmine\Api\IssueStatus::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -93,8 +93,8 @@ public function testAllReturnsClientGetResponseWithParametersAndProject()
->with(
$this->logicalAnd(
$this->stringStartsWith('/issue_statuses.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -128,7 +128,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/issue_statuses.json')
+ $this->stringStartsWith('/issue_statuses.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -162,7 +162,7 @@ public function testListingCallsGetOnlyTheFirstTime()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/issue_statuses.json')
+ $this->stringStartsWith('/issue_statuses.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -197,7 +197,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/issue_statuses.json')
+ $this->stringStartsWith('/issue_statuses.json'),
)
->willReturn(true);
$client->expects($this->exactly(2))
@@ -228,7 +228,7 @@ public function testGetIdByNameMakesGetRequest()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/issue_statuses.json')
+ $this->stringStartsWith('/issue_statuses.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/IssueTest.php b/tests/Unit/Api/IssueTest.php
index 0d468519..edce151c 100644
--- a/tests/Unit/Api/IssueTest.php
+++ b/tests/Unit/Api/IssueTest.php
@@ -49,13 +49,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Issue::all()` is deprecated since v2.4.0, use `Redmine\Api\Issue::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -115,8 +115,8 @@ public function testAllReturnsClientGetResponseWithParameters()
->with(
$this->logicalAnd(
$this->stringStartsWith('/issues.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -173,7 +173,7 @@ public function testCreateWithClientCleansParameters()
['issue_status', $getIdByNameApi],
['tracker', $getIdByNameApi],
['user', $getIdByUsernameApi],
- ]
+ ],
);
$client->expects($this->once())
@@ -188,8 +188,8 @@ public function testCreateWithClientCleansParameters()
$this->stringContains('cleanedValue'),
$this->stringContains('cleanedValue'),
$this->stringContains('cleanedValue'),
- $this->stringContains('cleanedValue')
- )
+ $this->stringContains('cleanedValue'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/Membership/CreateTest.php b/tests/Unit/Api/Membership/CreateTest.php
index ddb7d82b..c2f83bda 100644
--- a/tests/Unit/Api/Membership/CreateTest.php
+++ b/tests/Unit/Api/Membership/CreateTest.php
@@ -29,8 +29,8 @@ public function testCreateReturnsCorrectResponse($identifier, $parameters, $expe
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -76,8 +76,8 @@ public function testCreateReturnsEmptyString()
'42',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Membership/RemoveMemberTest.php b/tests/Unit/Api/Membership/RemoveMemberTest.php
index ef7cf38a..569ef5e5 100644
--- a/tests/Unit/Api/Membership/RemoveMemberTest.php
+++ b/tests/Unit/Api/Membership/RemoveMemberTest.php
@@ -26,7 +26,7 @@ public function testRemoveMemberReturnsCorrectResponse($projectIdentifier, $user
'',
200,
'application/json',
- '{"memberships":[{"id":2,"user":{"id":' . $userId . '}}]}'
+ '{"memberships":[{"id":2,"user":{"id":' . $userId . '}}]}',
],
[
'DELETE',
@@ -35,8 +35,8 @@ public function testRemoveMemberReturnsCorrectResponse($projectIdentifier, $user
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -79,8 +79,8 @@ public function testRemoveMemberReturnsFalseIfUserIsNotMemberOfProject()
'',
200,
'application/json',
- '{"memberships":[{"id":5,"user":{"id":404}}]}'
- ]
+ '{"memberships":[{"id":5,"user":{"id":404}}]}',
+ ],
);
// Create the object under test
@@ -101,8 +101,8 @@ public function testRemoveMemberReturnsFalseIfMemberlistIsMissing()
'',
200,
'application/json',
- '{"error":"this response is invalid"}'
- ]
+ '{"error":"this response is invalid"}',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Membership/RemoveTest.php b/tests/Unit/Api/Membership/RemoveTest.php
index 4b001060..eff7384c 100644
--- a/tests/Unit/Api/Membership/RemoveTest.php
+++ b/tests/Unit/Api/Membership/RemoveTest.php
@@ -26,8 +26,8 @@ public function testRemoveReturnsCorrectResponse($id, $expectedPath, $responseCo
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Membership/UpdateTest.php b/tests/Unit/Api/Membership/UpdateTest.php
index 69d5811b..dd103cc2 100644
--- a/tests/Unit/Api/Membership/UpdateTest.php
+++ b/tests/Unit/Api/Membership/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $parameters, $expectedPath
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -73,8 +73,8 @@ public function testUpdateReturnsEmptyString()
'24',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/MembershipTest.php b/tests/Unit/Api/MembershipTest.php
index eff8750e..bab9076e 100644
--- a/tests/Unit/Api/MembershipTest.php
+++ b/tests/Unit/Api/MembershipTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Membership::all()` is deprecated since v2.4.0, use `Redmine\Api\Membership::listByProject()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all(5);
@@ -93,8 +93,8 @@ public function testAllReturnsClientGetResponseWithParametersAndProject()
->with(
$this->logicalAnd(
$this->stringStartsWith('/projects/5/memberships.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/NewsTest.php b/tests/Unit/Api/NewsTest.php
index 1c9f2545..126c983e 100644
--- a/tests/Unit/Api/NewsTest.php
+++ b/tests/Unit/Api/NewsTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\News::all()` is deprecated since v2.4.0, use `Redmine\Api\News::list()` or `Redmine\Api\News::listByProject()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all(5);
@@ -91,7 +91,7 @@ public function testAllReturnsClientGetResponseWithProject()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/projects/5/news.json')
+ $this->stringStartsWith('/projects/5/news.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -124,7 +124,7 @@ public function testAllReturnsClientGetResponseWithParametersAndProject()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringContains('not-used')
+ $this->stringContains('not-used'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/Project/ArchiveTest.php b/tests/Unit/Api/Project/ArchiveTest.php
index 3e703897..9d43a358 100644
--- a/tests/Unit/Api/Project/ArchiveTest.php
+++ b/tests/Unit/Api/Project/ArchiveTest.php
@@ -24,8 +24,8 @@ public function testArchiveReturnsTrue()
'/projects/5/archive.xml',
'application/xml',
'',
- 204
- ]
+ 204,
+ ],
);
$api = new Project($client);
@@ -42,8 +42,8 @@ public function testArchiveThrowsUnexpectedResponseException()
'/projects/5/archive.xml',
'application/xml',
'',
- 403
- ]
+ 403,
+ ],
);
$api = new Project($client);
diff --git a/tests/Unit/Api/Project/CloseTest.php b/tests/Unit/Api/Project/CloseTest.php
index f40bb2b4..778bb0fa 100644
--- a/tests/Unit/Api/Project/CloseTest.php
+++ b/tests/Unit/Api/Project/CloseTest.php
@@ -22,8 +22,8 @@ public function testCloseReturnsTrue()
'/projects/5/close.xml',
'application/xml',
'',
- 204
- ]
+ 204,
+ ],
);
$api = new Project($client);
@@ -40,8 +40,8 @@ public function testCloseThrowsUnexpectedResponseException()
'/projects/5/close.xml',
'application/xml',
'',
- 403
- ]
+ 403,
+ ],
);
$api = new Project($client);
diff --git a/tests/Unit/Api/Project/CreateTest.php b/tests/Unit/Api/Project/CreateTest.php
index 98cfdae8..751fec50 100644
--- a/tests/Unit/Api/Project/CreateTest.php
+++ b/tests/Unit/Api/Project/CreateTest.php
@@ -29,8 +29,8 @@ public function testCreateReturnsCorrectResponse($parameters, $expectedPath, $ex
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -142,8 +142,8 @@ public function testCreateReturnsEmptyString()
'Test Projecttest-project',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Project/RemoveTest.php b/tests/Unit/Api/Project/RemoveTest.php
index 59d7efb3..0a4300e6 100644
--- a/tests/Unit/Api/Project/RemoveTest.php
+++ b/tests/Unit/Api/Project/RemoveTest.php
@@ -26,8 +26,8 @@ public function testRemoveReturnsCorrectResponse($id, $expectedPath, $responseCo
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Project/ReopenTest.php b/tests/Unit/Api/Project/ReopenTest.php
index f9426ffb..26a83e80 100644
--- a/tests/Unit/Api/Project/ReopenTest.php
+++ b/tests/Unit/Api/Project/ReopenTest.php
@@ -22,8 +22,8 @@ public function testReopenReturnsTrue()
'/projects/5/reopen.xml',
'application/xml',
'',
- 204
- ]
+ 204,
+ ],
);
$api = new Project($client);
@@ -40,8 +40,8 @@ public function testReopenThrowsUnexpectedResponseException()
'/projects/5/reopen.xml',
'application/xml',
'',
- 403
- ]
+ 403,
+ ],
);
$api = new Project($client);
diff --git a/tests/Unit/Api/Project/ShowTest.php b/tests/Unit/Api/Project/ShowTest.php
index f8d4c663..fc646992 100644
--- a/tests/Unit/Api/Project/ShowTest.php
+++ b/tests/Unit/Api/Project/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($identifier, array $params, $expe
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Project/UnarchiveTest.php b/tests/Unit/Api/Project/UnarchiveTest.php
index 84776bf2..182b0eb8 100644
--- a/tests/Unit/Api/Project/UnarchiveTest.php
+++ b/tests/Unit/Api/Project/UnarchiveTest.php
@@ -22,8 +22,8 @@ public function testUnarchiveReturnsTrue()
'/projects/5/unarchive.xml',
'application/xml',
'',
- 204
- ]
+ 204,
+ ],
);
$api = new Project($client);
@@ -40,8 +40,8 @@ public function testUnarchiveThrowsUnexpectedResponseException()
'/projects/5/unarchive.xml',
'application/xml',
'',
- 403
- ]
+ 403,
+ ],
);
$api = new Project($client);
diff --git a/tests/Unit/Api/Project/UpdateTest.php b/tests/Unit/Api/Project/UpdateTest.php
index 3380c41f..7abd087c 100644
--- a/tests/Unit/Api/Project/UpdateTest.php
+++ b/tests/Unit/Api/Project/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $parameters, $expectedPath
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/ProjectTest.php b/tests/Unit/Api/ProjectTest.php
index 0e4d4a1a..2da7f651 100644
--- a/tests/Unit/Api/ProjectTest.php
+++ b/tests/Unit/Api/ProjectTest.php
@@ -29,13 +29,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Project::all()` is deprecated since v2.4.0, use `Redmine\Api\Project::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -95,8 +95,8 @@ public function testAllReturnsClientGetResponseWithParameters()
->with(
$this->logicalAnd(
$this->stringStartsWith('/projects.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -130,7 +130,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/projects.json')
+ $this->stringStartsWith('/projects.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -164,7 +164,7 @@ public function testListingCallsGetOnlyTheFirstTime()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/projects.json')
+ $this->stringStartsWith('/projects.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -199,7 +199,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/projects.json')
+ $this->stringStartsWith('/projects.json'),
)
->willReturn(true);
$client->expects($this->exactly(2))
@@ -230,7 +230,7 @@ public function testGetIdByNameMakesGetRequest()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/projects.json')
+ $this->stringStartsWith('/projects.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/QueryTest.php b/tests/Unit/Api/QueryTest.php
index 10411455..d2dc0e5a 100644
--- a/tests/Unit/Api/QueryTest.php
+++ b/tests/Unit/Api/QueryTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Query::all()` is deprecated since v2.4.0, use `Redmine\Api\Query::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -93,8 +93,8 @@ public function testAllReturnsClientGetResponseWithParameters()
->with(
$this->logicalAnd(
$this->stringStartsWith('/queries.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/Role/ShowTest.php b/tests/Unit/Api/Role/ShowTest.php
index 4dd64df3..398085dd 100644
--- a/tests/Unit/Api/Role/ShowTest.php
+++ b/tests/Unit/Api/Role/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($id, $expectedPath, $response, $e
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/RoleTest.php b/tests/Unit/Api/RoleTest.php
index 51263ba6..53bebefc 100644
--- a/tests/Unit/Api/RoleTest.php
+++ b/tests/Unit/Api/RoleTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Role::all()` is deprecated since v2.4.0, use `Redmine\Api\Role::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -93,8 +93,8 @@ public function testAllReturnsClientGetResponseWithParametersAndProject()
->with(
$this->logicalAnd(
$this->stringStartsWith('/roles.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -128,7 +128,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/roles.json')
+ $this->stringStartsWith('/roles.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -162,7 +162,7 @@ public function testListingCallsGetOnlyTheFirstTime()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/roles.json')
+ $this->stringStartsWith('/roles.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -197,7 +197,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/roles.json')
+ $this->stringStartsWith('/roles.json'),
)
->willReturn(true);
$client->expects($this->exactly(2))
diff --git a/tests/Unit/Api/Search/SearchTest.php b/tests/Unit/Api/Search/SearchTest.php
index def15aee..524e3445 100644
--- a/tests/Unit/Api/Search/SearchTest.php
+++ b/tests/Unit/Api/Search/SearchTest.php
@@ -21,13 +21,13 @@ public function testSearchTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Search::search()` is deprecated since v2.4.0, use `Redmine\Api\Search::listByQuery()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->search('query');
diff --git a/tests/Unit/Api/TimeEntry/CreateTest.php b/tests/Unit/Api/TimeEntry/CreateTest.php
index 4bbbb7c2..0741de79 100644
--- a/tests/Unit/Api/TimeEntry/CreateTest.php
+++ b/tests/Unit/Api/TimeEntry/CreateTest.php
@@ -29,8 +29,8 @@ public function testCreateReturnsCorrectResponse($parameters, $expectedPath, $ex
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -114,8 +114,8 @@ public function testCreateReturnsEmptyString()
'55.25',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/TimeEntry/RemoveTest.php b/tests/Unit/Api/TimeEntry/RemoveTest.php
index f9be0d6b..498ae5a9 100644
--- a/tests/Unit/Api/TimeEntry/RemoveTest.php
+++ b/tests/Unit/Api/TimeEntry/RemoveTest.php
@@ -26,8 +26,8 @@ public function testRemoveReturnsCorrectResponse($id, $expectedPath, $responseCo
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/TimeEntry/ShowTest.php b/tests/Unit/Api/TimeEntry/ShowTest.php
index c6444407..a255fb99 100644
--- a/tests/Unit/Api/TimeEntry/ShowTest.php
+++ b/tests/Unit/Api/TimeEntry/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($id, $expectedPath, $response, $e
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/TimeEntry/UpdateTest.php b/tests/Unit/Api/TimeEntry/UpdateTest.php
index 0023bccd..7d0516f8 100644
--- a/tests/Unit/Api/TimeEntry/UpdateTest.php
+++ b/tests/Unit/Api/TimeEntry/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $parameters, $expectedPath
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/TimeEntryActivityTest.php b/tests/Unit/Api/TimeEntryActivityTest.php
index e74118d7..a8d46c0b 100644
--- a/tests/Unit/Api/TimeEntryActivityTest.php
+++ b/tests/Unit/Api/TimeEntryActivityTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\TimeEntryActivity::all()` is deprecated since v2.4.0, use `Redmine\Api\TimeEntryActivity::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -93,8 +93,8 @@ public function testAllReturnsClientGetResponseWithParameters()
->with(
$this->logicalAnd(
$this->stringStartsWith('/enumerations/time_entry_activities.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -123,7 +123,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->atLeastOnce())
->method('requestGet')
->with(
- $this->stringStartsWith('/enumerations/time_entry_activities.json')
+ $this->stringStartsWith('/enumerations/time_entry_activities.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -150,7 +150,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/enumerations/time_entry_activities.json')
+ $this->stringStartsWith('/enumerations/time_entry_activities.json'),
)
->willReturn(true);
$client->expects($this->exactly(2))
@@ -174,7 +174,7 @@ public function testGetIdByNameMakesGetRequest()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/enumerations/time_entry_activities.json')
+ $this->stringStartsWith('/enumerations/time_entry_activities.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/TimeEntryTest.php b/tests/Unit/Api/TimeEntryTest.php
index 9429ad6e..8e4eb71a 100644
--- a/tests/Unit/Api/TimeEntryTest.php
+++ b/tests/Unit/Api/TimeEntryTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\TimeEntry::all()` is deprecated since v2.4.0, use `Redmine\Api\TimeEntry::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -99,8 +99,8 @@ public function testAllReturnsClientGetResponseWithParameters()
$this->stringStartsWith('/time_entries.json?'),
$this->stringContains('project_id=5'),
$this->stringContains('user_id=10'),
- $this->stringContains('limit=2')
- )
+ $this->stringContains('limit=2'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/TrackerTest.php b/tests/Unit/Api/TrackerTest.php
index 4ba07e45..70c3bda7 100644
--- a/tests/Unit/Api/TrackerTest.php
+++ b/tests/Unit/Api/TrackerTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Tracker::all()` is deprecated since v2.4.0, use `Redmine\Api\Tracker::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -93,8 +93,8 @@ public function testAllReturnsClientGetResponseWithParametersAndProject()
->with(
$this->logicalAnd(
$this->stringStartsWith('/trackers.json'),
- $this->stringContains('not-used')
- )
+ $this->stringContains('not-used'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -128,7 +128,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/trackers.json')
+ $this->stringStartsWith('/trackers.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -162,7 +162,7 @@ public function testListingCallsGetOnlyTheFirstTime()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/trackers.json')
+ $this->stringStartsWith('/trackers.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -197,7 +197,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/trackers.json')
+ $this->stringStartsWith('/trackers.json'),
)
->willReturn(true);
$client->expects($this->exactly(2))
@@ -228,7 +228,7 @@ public function testGetIdByNameMakesGetRequest()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/trackers.json')
+ $this->stringStartsWith('/trackers.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/User/CreateTest.php b/tests/Unit/Api/User/CreateTest.php
index 556f67ae..72fe0a0c 100644
--- a/tests/Unit/Api/User/CreateTest.php
+++ b/tests/Unit/Api/User/CreateTest.php
@@ -29,8 +29,8 @@ public function testCreateReturnsCorrectResponse($parameters, $expectedPath, $ex
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -101,8 +101,8 @@ public function testCreateReturnsEmptyString()
'userlastfirstmail@example.com',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/User/RemoveTest.php b/tests/Unit/Api/User/RemoveTest.php
index 921f421b..158635b0 100644
--- a/tests/Unit/Api/User/RemoveTest.php
+++ b/tests/Unit/Api/User/RemoveTest.php
@@ -26,8 +26,8 @@ public function testRemoveReturnsCorrectResponse($id, $expectedPath, $responseCo
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/User/ShowTest.php b/tests/Unit/Api/User/ShowTest.php
index 9de66df5..e6e15c9d 100644
--- a/tests/Unit/Api/User/ShowTest.php
+++ b/tests/Unit/Api/User/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($userId, array $params, $expected
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/User/UpdateTest.php b/tests/Unit/Api/User/UpdateTest.php
index f53be82c..6cb42e0f 100644
--- a/tests/Unit/Api/User/UpdateTest.php
+++ b/tests/Unit/Api/User/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $parameters, $expectedPath
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/UserTest.php b/tests/Unit/Api/UserTest.php
index 67a37ae0..cc781a1c 100644
--- a/tests/Unit/Api/UserTest.php
+++ b/tests/Unit/Api/UserTest.php
@@ -31,8 +31,8 @@ public function testGetCurrentUserReturnsClientGetResponse()
->with(
$this->logicalAnd(
$this->stringStartsWith('/users/current.json'),
- $this->stringContains(urlencode('memberships,groups'))
- )
+ $this->stringContains(urlencode('memberships,groups')),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -62,7 +62,7 @@ public function testGetIdByUsernameMakesGetRequest()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/users.json')
+ $this->stringStartsWith('/users.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -95,13 +95,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\User::all()` is deprecated since v2.4.0, use `Redmine\Api\User::list()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all();
@@ -165,8 +165,8 @@ public function testAllReturnsClientGetResponseWithParameters()
$this->logicalAnd(
$this->stringStartsWith('/users.json?'),
$this->stringContains('offset=10'),
- $this->stringContains('limit=2')
- )
+ $this->stringContains('limit=2'),
+ ),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -200,7 +200,7 @@ public function testListingReturnsNameIdArray()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/users.json')
+ $this->stringStartsWith('/users.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -234,7 +234,7 @@ public function testListingCallsGetOnlyTheFirstTime()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/users.json')
+ $this->stringStartsWith('/users.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
@@ -269,7 +269,7 @@ public function testListingCallsGetEveryTimeWithForceUpdate()
$client->expects($this->exactly(2))
->method('requestGet')
->with(
- $this->stringStartsWith('/users.json')
+ $this->stringStartsWith('/users.json'),
)
->willReturn(true);
$client->expects($this->exactly(2))
diff --git a/tests/Unit/Api/Version/CreateTest.php b/tests/Unit/Api/Version/CreateTest.php
index 8b7d6d8a..4a2fbaf3 100644
--- a/tests/Unit/Api/Version/CreateTest.php
+++ b/tests/Unit/Api/Version/CreateTest.php
@@ -30,8 +30,8 @@ public function testCreateReturnsCorrectResponse($identifier, $parameters, $expe
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
@@ -141,8 +141,8 @@ public function testCreateReturnsEmptyString()
'test',
500,
'',
- ''
- ]
+ '',
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Version/RemoveTest.php b/tests/Unit/Api/Version/RemoveTest.php
index d473dee7..16b98c8e 100644
--- a/tests/Unit/Api/Version/RemoveTest.php
+++ b/tests/Unit/Api/Version/RemoveTest.php
@@ -26,8 +26,8 @@ public function testRemoveReturnsCorrectResponse($id, $expectedPath, $responseCo
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Version/ShowTest.php b/tests/Unit/Api/Version/ShowTest.php
index 15286c8a..0c3f6fc9 100644
--- a/tests/Unit/Api/Version/ShowTest.php
+++ b/tests/Unit/Api/Version/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($version, $expectedPath, $respons
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Version/UpdateTest.php b/tests/Unit/Api/Version/UpdateTest.php
index 130691a1..e51cc786 100644
--- a/tests/Unit/Api/Version/UpdateTest.php
+++ b/tests/Unit/Api/Version/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $parameters, $expectedPath
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Update the object under test
diff --git a/tests/Unit/Api/VersionTest.php b/tests/Unit/Api/VersionTest.php
index 7a24b08d..6bbbfa7c 100644
--- a/tests/Unit/Api/VersionTest.php
+++ b/tests/Unit/Api/VersionTest.php
@@ -28,13 +28,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Version::all()` is deprecated since v2.4.0, use `Redmine\Api\Version::listByProject()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all(5);
@@ -98,8 +98,8 @@ public function testAllReturnsClientGetResponseWithParameters()
$this->logicalAnd(
$this->stringStartsWith('/projects/5/versions.json'),
$this->stringContains('offset=10'),
- $this->stringContains('limit=2')
- )
+ $this->stringContains('limit=2'),
+ ),
)
->willReturn(true);
$client->expects($this->once())
@@ -259,7 +259,7 @@ public function testGetIdByNameMakesGetRequest()
$client->expects($this->once())
->method('requestGet')
->with(
- $this->stringStartsWith('/projects/5/versions.json')
+ $this->stringStartsWith('/projects/5/versions.json'),
)
->willReturn(true);
$client->expects($this->exactly(1))
diff --git a/tests/Unit/Api/Wiki/CreateTest.php b/tests/Unit/Api/Wiki/CreateTest.php
index 501f7ea5..f1e46d1e 100644
--- a/tests/Unit/Api/Wiki/CreateTest.php
+++ b/tests/Unit/Api/Wiki/CreateTest.php
@@ -29,8 +29,8 @@ public function testCreateReturnsCorrectResponse($id, $page, $parameters, $expec
$expectedBody,
$responseCode,
'application/xml',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Wiki/RemoveTest.php b/tests/Unit/Api/Wiki/RemoveTest.php
index 42f4563e..6dfb9eff 100644
--- a/tests/Unit/Api/Wiki/RemoveTest.php
+++ b/tests/Unit/Api/Wiki/RemoveTest.php
@@ -28,8 +28,8 @@ public function testRemoveReturnsCorrectResponse($id, $page, $expectedPath, $res
'',
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Wiki/ShowTest.php b/tests/Unit/Api/Wiki/ShowTest.php
index eb6b2fb5..00d23c41 100644
--- a/tests/Unit/Api/Wiki/ShowTest.php
+++ b/tests/Unit/Api/Wiki/ShowTest.php
@@ -26,8 +26,8 @@ public function testShowReturnsCorrectResponse($identifier, $page, $version, $ex
'',
200,
'application/json',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/Wiki/UpdateTest.php b/tests/Unit/Api/Wiki/UpdateTest.php
index 7f28dcc4..3ed667ff 100644
--- a/tests/Unit/Api/Wiki/UpdateTest.php
+++ b/tests/Unit/Api/Wiki/UpdateTest.php
@@ -28,8 +28,8 @@ public function testUpdateReturnsCorrectResponse($id, $page, $parameters, $expec
$expectedBody,
$responseCode,
'',
- $response
- ]
+ $response,
+ ],
);
// Create the object under test
diff --git a/tests/Unit/Api/WikiTest.php b/tests/Unit/Api/WikiTest.php
index 7e03a74f..3fe1f2a7 100644
--- a/tests/Unit/Api/WikiTest.php
+++ b/tests/Unit/Api/WikiTest.php
@@ -27,13 +27,13 @@ public function testAllTriggersDeprecationWarning()
function ($errno, $errstr): bool {
$this->assertSame(
'`Redmine\Api\Wiki::all()` is deprecated since v2.4.0, use `Redmine\Api\Wiki::listByProject()` instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$api->all(5);
@@ -97,8 +97,8 @@ public function testAllReturnsClientGetResponseWithParameters()
$this->logicalAnd(
$this->stringStartsWith('/projects/5/wiki/index.json'),
$this->stringContains('offset=10'),
- $this->stringContains('limit=2')
- )
+ $this->stringContains('limit=2'),
+ ),
)
->willReturn(true);
$client->expects($this->once())
diff --git a/tests/Unit/Client/NativeCurlClient/RequestTest.php b/tests/Unit/Client/NativeCurlClient/RequestTest.php
index 63523a24..24d2cfff 100644
--- a/tests/Unit/Client/NativeCurlClient/RequestTest.php
+++ b/tests/Unit/Client/NativeCurlClient/RequestTest.php
@@ -47,7 +47,7 @@ public function testRequestReturnsCorrectResponse($method, $data, $statusCode, $
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
/** @var Request|\PHPUnit\Framework\MockObject\MockObject */
@@ -120,7 +120,7 @@ public function testRequestWithUploadAndFilepathReturnsCorrectResponse()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
// PHPUnit 10 compatible way to test trigger_error().
@@ -128,13 +128,13 @@ public function testRequestWithUploadAndFilepathReturnsCorrectResponse()
function ($errno, $errstr): bool {
$this->assertSame(
'Uploading an attachment by filepath is deprecated since v2.1.0, use file_get_contents() to upload the file content instead.',
- $errstr
+ $errstr,
);
restore_error_handler();
return true;
},
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
/** @var Request|\PHPUnit\Framework\MockObject\MockObject */
diff --git a/tests/Unit/Client/NativeCurlClientTest.php b/tests/Unit/Client/NativeCurlClientTest.php
index 32af6d89..610f4510 100644
--- a/tests/Unit/Client/NativeCurlClientTest.php
+++ b/tests/Unit/Client/NativeCurlClientTest.php
@@ -39,7 +39,7 @@ public function testApiKeyShouldBePassToConstructor()
{
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertInstanceOf(NativeCurlClient::class, $client);
@@ -52,7 +52,7 @@ public function testShouldPassUsernameAndPasswordToConstructor()
$client = new NativeCurlClient(
'http://test.local',
'username',
- 'password'
+ 'password',
);
$this->assertInstanceOf(NativeCurlClient::class, $client);
@@ -63,7 +63,7 @@ public function testGetLastResponseStatusCodeIsInitialNull()
{
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame(0, $client->getLastResponseStatusCode());
@@ -73,7 +73,7 @@ public function testGetLastResponseContentTypeIsInitialEmpty()
{
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame('', $client->getLastResponseContentType());
@@ -83,7 +83,7 @@ public function testGetLastResponseBodyIsInitialEmpty()
{
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame('', $client->getLastResponseBody());
@@ -135,7 +135,7 @@ public function testStartAndStopImpersonateUser()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -190,7 +190,7 @@ public function testSetSslVersion()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -246,7 +246,7 @@ public function testSetSslVerifypeer()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -302,7 +302,7 @@ public function testSetSslVerifyhost()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -359,7 +359,7 @@ public function testSetCustomHttpHeaders()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -420,7 +420,7 @@ public function testSetCustomHost()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -477,7 +477,7 @@ public function testSetPort()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -531,7 +531,7 @@ public function testCustomPortWillSetFromSchema()
$client = new NativeCurlClient(
'https://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -570,7 +570,7 @@ public function testCustomPortWillSetFromUrl()
$curlSetoptArray->expects($this->exactly(1))
->with(
$this->anything(),
- $this->identicalTo($expectedOptions)
+ $this->identicalTo($expectedOptions),
)
;
@@ -581,7 +581,7 @@ public function testCustomPortWillSetFromUrl()
$client = new NativeCurlClient(
'http://test.local:3456',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -616,7 +616,7 @@ public function testRequestsReturnsCorrectContent($method, $data, $boolReturn, $
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame($boolReturn, $client->$method('/path', $data));
@@ -680,7 +680,7 @@ public function testHandlingOfResponseWithoutContent()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame(true, $client->requestPut('/path', '{"foo":"bar"}'));
@@ -711,7 +711,7 @@ public function testCurlErrorThrowsException()
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->expectException(Exception::class);
@@ -728,7 +728,7 @@ public function testGetApiShouldReturnApiInstance(string $apiName, string $class
{
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertInstanceOf($class, $client->getApi($apiName));
@@ -763,7 +763,7 @@ public function testGetApiShouldThrowException()
{
$client = new NativeCurlClient(
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->expectException(InvalidArgumentException::class);
diff --git a/tests/Unit/Client/Psr18Client/RequestTest.php b/tests/Unit/Client/Psr18Client/RequestTest.php
index 44d684ed..e766d6fa 100644
--- a/tests/Unit/Client/Psr18Client/RequestTest.php
+++ b/tests/Unit/Client/Psr18Client/RequestTest.php
@@ -34,7 +34,7 @@ public function testRequestReturnsCorrectResponse($method, $data, $statusCode, $
'getBody' => $this->createConfiguredMock(StreamInterface::class, [
'__toString' => $content,
]),
- ])
+ ]),
]);
$requestFactory = $this->createConfiguredMock(RequestFactoryInterface::class, [
@@ -52,7 +52,7 @@ public function testRequestReturnsCorrectResponse($method, $data, $statusCode, $
$requestFactory,
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$request = $this->createConfiguredMock(Request::class, [
@@ -101,7 +101,7 @@ public function testRequestThrowsClientException()
{
$httpClient = $this->createMock(ClientInterface::class);
$httpClient->expects($this->exactly(1))->method('sendRequest')->willThrowException(
- new class ('error message') extends Exception implements ClientExceptionInterface {}
+ new class ('error message') extends Exception implements ClientExceptionInterface {},
);
$requestFactory = $this->createConfiguredMock(RequestFactoryInterface::class, [
@@ -119,7 +119,7 @@ public function testRequestThrowsClientException()
$requestFactory,
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$request = $this->createConfiguredMock(Request::class, [
diff --git a/tests/Unit/Client/Psr18ClientTest.php b/tests/Unit/Client/Psr18ClientTest.php
index 0bd722f8..b28bf85d 100644
--- a/tests/Unit/Client/Psr18ClientTest.php
+++ b/tests/Unit/Client/Psr18ClientTest.php
@@ -30,7 +30,7 @@ public function testShouldPassApiKeyToConstructor()
$this->createMock(RequestFactoryInterface::class),
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertInstanceOf(Psr18Client::class, $client);
@@ -53,7 +53,7 @@ public function testServerRequestFactoryIsAcceptedInConstructorForBC()
]),
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertInstanceOf(Psr18Client::class, $client);
@@ -70,7 +70,7 @@ public function testShouldPassUsernameAndPasswordToConstructor()
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
'username',
- 'password'
+ 'password',
);
$this->assertInstanceOf(Psr18Client::class, $client);
@@ -84,7 +84,7 @@ public function testGetLastResponseStatusCodeIsInitialZero()
$this->createMock(RequestFactoryInterface::class),
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame(0, $client->getLastResponseStatusCode());
@@ -97,7 +97,7 @@ public function testGetLastResponseContentTypeIsInitialEmpty()
$this->createMock(RequestFactoryInterface::class),
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame('', $client->getLastResponseContentType());
@@ -110,7 +110,7 @@ public function testGetLastResponseBodyIsInitialEmpty()
$this->createMock(RequestFactoryInterface::class),
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame('', $client->getLastResponseBody());
@@ -136,7 +136,7 @@ public function testStartAndStopImpersonateUser()
$requestFactory,
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$client->requestGet('/path');
@@ -165,7 +165,7 @@ public function testRequestGetReturnsFalse()
$requestFactory,
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame(false, $client->requestGet('/path'));
@@ -200,7 +200,7 @@ public function testRequestsReturnsCorrectContent($method, $data, $boolReturn, $
$requestFactory,
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertSame($boolReturn, $client->$method('/path', $data));
@@ -246,7 +246,7 @@ public function testGetApiShouldReturnApiInstance(string $apiName, string $class
$this->createMock(RequestFactoryInterface::class),
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->assertInstanceOf($class, $client->getApi($apiName));
@@ -288,7 +288,7 @@ public function testCreateWithoutFactoryThrowsException()
new stdClass(),
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
}
@@ -299,7 +299,7 @@ public function testGetApiShouldThrowException()
$this->createMock(RequestFactoryInterface::class),
$this->createMock(StreamFactoryInterface::class),
'http://test.local',
- 'access_token'
+ 'access_token',
);
$this->expectException(InvalidArgumentException::class);
diff --git a/tests/Unit/Serializer/XmlSerializerTest.php b/tests/Unit/Serializer/XmlSerializerTest.php
index 12d16dd1..4e5953b4 100644
--- a/tests/Unit/Serializer/XmlSerializerTest.php
+++ b/tests/Unit/Serializer/XmlSerializerTest.php
@@ -314,7 +314,7 @@ public static function getInvalidSerializedData(): array
'invalid element name as start tag' => [
'Could not create XML from array: "StartTag: invalid element name' . "\n" . '", "Extra content at the end of the document' . "\n" . '"',
['0' => ['foobar']],
- ]
+ ],
];
}
}