@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | public function getChildren(Issue $issue): IdentityCollection | ArrayCollection |
| 114 | 114 | { |
| 115 | 115 | return $this->client->getRepository(self::API_ROOT) |
| 116 | - ?->addFilter(self::ISSUE_FILTER_PARENT_ID, $issue->getId()) |
|
| 116 | + ? ->addFilter(self::ISSUE_FILTER_PARENT_ID, $issue->getId()) |
|
| 117 | 117 | ->addFilter(self::ISSUE_FILTER_STATUS_ID, "*") |
| 118 | 118 | ->search(); |
| 119 | 119 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function addAttachment(Issue $issue, Attachment $attachment): Issue |
| 128 | 128 | { |
| 129 | - $attachment = $this->client->getRepository(Uploads::API_ROOT)?->create($attachment); |
|
| 129 | + $attachment = $this->client->getRepository(Uploads::API_ROOT) ? ->create($attachment); |
|
| 130 | 130 | if ($attachment) { |
| 131 | 131 | $attachment->setVersion($issue->getFixedVersion()); |
| 132 | 132 | $issue->addAttachment($attachment); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | public function addTimeEntry(Project $project, TimeEntry $time_entry): Project |
| 72 | 72 | { |
| 73 | 73 | $time_entry->setProject($project); |
| 74 | - $this->client->getRepository(TimeEntries::API_ROOT)?->create($time_entry); |
|
| 74 | + $this->client->getRepository(TimeEntries::API_ROOT) ? ->create($time_entry); |
|
| 75 | 75 | |
| 76 | 76 | return $project; |
| 77 | 77 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function addFile(Project $project, File $file): Project |
| 118 | 118 | { |
| 119 | - $file = $this->client->getRepository(Uploads::API_ROOT)?->create($file); |
|
| 119 | + $file = $this->client->getRepository(Uploads::API_ROOT) ? ->create($file); |
|
| 120 | 120 | if ($file) { |
| 121 | 121 | $file->setVersion($project->getDefaultVersion()); |
| 122 | 122 | |
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | */ |
| 139 | 139 | public function addAttachment(WikiPage $wiki_page, Attachment $attachment): WikiPage |
| 140 | 140 | { |
| 141 | - $attachment = $this->client->getRepository(Uploads::API_ROOT)?->create($attachment); |
|
| 141 | + $attachment = $this->client->getRepository(Uploads::API_ROOT) ? ->create($attachment); |
|
| 142 | 142 | if ($attachment) { |
| 143 | 143 | $wiki_page->addAttachment($attachment); |
| 144 | 144 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | private function getFactoryFor(string $model_class, ?string $custom_endpoint): FactoryInterface |
| 58 | 58 | { |
| 59 | 59 | $repository_class = $model_class::getRepositoryClass(); |
| 60 | - $values = $this->client->getRepository($repository_class::API_ROOT)?->all($custom_endpoint)->toArray(); |
|
| 60 | + $values = $this->client->getRepository($repository_class::API_ROOT) ? ->all($custom_endpoint)->toArray(); |
|
| 61 | 61 | |
| 62 | 62 | return new NamedIdentityFactory($values, $model_class); |
| 63 | 63 | } |
@@ -52,11 +52,11 @@ |
||
| 52 | 52 | public static function fromApiResponse(ApiResponse $api_response, ?Throwable $previous = null): AbstractApiException | Error |
| 53 | 53 | { |
| 54 | 54 | return match($api_response->getStatus()) { |
| 55 | - 401 => new UnauthorizedApiException(previous: $previous), |
|
| 56 | - 403 => new InaccessibleResourceException(previous: $previous), |
|
| 57 | - 404 => new EntityNotFoundException(previous: $previous), |
|
| 58 | - 422 => new MalformedPayloadException(previous: $previous, errors: $api_response->getData()), |
|
| 59 | - default => new Error(message: "Undefined error", code: 1000, previous: $previous), |
|
| 55 | + 401 => new UnauthorizedApiException(previous : $previous), |
|
| 56 | + 403 => new InaccessibleResourceException(previous : $previous), |
|
| 57 | + 404 => new EntityNotFoundException(previous : $previous), |
|
| 58 | + 422 => new MalformedPayloadException(previous : $previous, errors : $api_response->getData()), |
|
| 59 | + default => new Error(message : "Undefined error", code : 1000, previous : $previous), |
|
| 60 | 60 | }; |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | public function search(array $params = []): ArrayCollection |
| 70 | 70 | { |
| 71 | - throw new Error("Method " . __FUNCTION__ . "not implemented for apì: " . self::API_ROOT); |
|
| 71 | + throw new Error("Method " . __FUNCTION__ . "not implemented for apì: " . self::API_ROOT); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | public function create(AbstractModel $model): ?AbstractModel |
| 69 | 69 | { |
| 70 | 70 | $model = $this->repository->create($model); |
| 71 | - if ($model?->isCacheable()) { |
|
| 71 | + if ($model ? ->isCacheable()) { |
|
| 72 | 72 | return $this->cacheModel($model); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public function update(AbstractModel $model): ?AbstractModel |
| 85 | 85 | { |
| 86 | 86 | $model = $this->repository->update($model); |
| 87 | - if ($model?->isCacheable()) { |
|
| 87 | + if ($model ? ->isCacheable()) { |
|
| 88 | 88 | return $this->cacheModel($model); |
| 89 | 89 | } |
| 90 | 90 | |