@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | private function getRepositoryForEndpoint(string $endpoint): ?AbstractRepository |
| 55 | 55 | { |
| 56 | - return match ($endpoint) { |
|
| 56 | + return match($endpoint) { |
|
| 57 | 57 | Issues::API_ROOT => new Issues($this), |
| 58 | 58 | Users::API_ROOT => new Users($this), |
| 59 | 59 | Projects::API_ROOT => new Projects($this), |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public function get(mixed $id): ?AbstractModel |
| 48 | 48 | { |
| 49 | 49 | $cache_key = $this->generator->generate($this->repository->getModelClass(), $id); |
| 50 | - return $this->cache->get($cache_key, function (ItemInterface $item) use ($id) { |
|
| 50 | + return $this->cache->get($cache_key, function(ItemInterface $item) use ($id) { |
|
| 51 | 51 | $model = $this->repository->get($id); |
| 52 | 52 | if ($model) { |
| 53 | 53 | $item->set($model); |
@@ -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 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | json_encode(static::$filter_params, JSON_THROW_ON_ERROR) |
| 121 | 121 | ); |
| 122 | 122 | |
| 123 | - return $this->cache->get($cache_key, function (ItemInterface $item) { |
|
| 123 | + return $this->cache->get($cache_key, function(ItemInterface $item) { |
|
| 124 | 124 | $search_results = $this->doSearch(); |
| 125 | 125 | if (!$search_results->isEmpty()) { |
| 126 | 126 | $item->set($search_results); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $cache_key = $this->generator->generate($model->getEntityName(), $model->getId()); |
| 167 | 167 | |
| 168 | 168 | $this->cache->delete($cache_key); |
| 169 | - return $this->cache->get($cache_key, function (ItemInterface $item) use ($model) { |
|
| 169 | + return $this->cache->get($cache_key, function(ItemInterface $item) use ($model) { |
|
| 170 | 170 | $item->set($model); |
| 171 | 171 | $item->expiresAfter($this->getCacheTTL()); |
| 172 | 172 | if ($this->supportsTagging()) { |
@@ -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 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $has_parent = $element->getParent(); |
| 61 | 61 | if ($has_parent) { |
| 62 | 62 | $getter = "get" . ucfirst(Inflect::camelize($this->parent_field)); |
| 63 | - $parent = $this->findBy($this->parent_field, $element->getParent()?->$getter(), true); |
|
| 63 | + $parent = $this->findBy($this->parent_field, $element->getParent() ? ->$getter(), true); |
|
| 64 | 64 | if ($parent) { |
| 65 | 65 | $parent->addChild($element); |
| 66 | 66 | $this->replaceBy($this->parent_field, $parent, true); |
@@ -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 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function addFile(Project $project, File $file): Project |
| 120 | 120 | { |
| 121 | - $file = $this->client->getRepository(Uploads::API_ROOT)?->create($file); |
|
| 121 | + $file = $this->client->getRepository(Uploads::API_ROOT) ? ->create($file); |
|
| 122 | 122 | /** @var File $file */ |
| 123 | 123 | if ($file !== null) { |
| 124 | 124 | $file->setVersion($project->getDefaultVersion()); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | public function getChildren(Issue $issue): IdentityCollection | ArrayCollection |
| 115 | 115 | { |
| 116 | 116 | return $this->client->getRepository(self::API_ROOT) |
| 117 | - ?->addFilter(self::ISSUE_FILTER_PARENT_ID, $issue->getId()) |
|
| 117 | + ? ->addFilter(self::ISSUE_FILTER_PARENT_ID, $issue->getId()) |
|
| 118 | 118 | ->addFilter(self::ISSUE_FILTER_STATUS_ID, "*") |
| 119 | 119 | ->search(); |
| 120 | 120 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function addAttachment(Issue $issue, Attachment $attachment): Issue |
| 129 | 129 | { |
| 130 | - $attachment = $this->client->getRepository(Uploads::API_ROOT)?->create($attachment); |
|
| 130 | + $attachment = $this->client->getRepository(Uploads::API_ROOT) ? ->create($attachment); |
|
| 131 | 131 | /** @var Attachment $attachment */ |
| 132 | 132 | if ($attachment !== null) { |
| 133 | 133 | $attachment->setVersion($issue->getFixedVersion()); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | return $ret; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function getStatus(): int|bool |
|
| 36 | + public function getStatus(): int | bool |
|
| 37 | 37 | { |
| 38 | 38 | return $this->status; |
| 39 | 39 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $method_prefix = Inflect::extractPrefix($method); |
| 29 | 29 | |
| 30 | - return match ($method_prefix) { |
|
| 30 | + return match($method_prefix) { |
|
| 31 | 31 | Inflect::GETTER_PREFIX => $this->getter($method), |
| 32 | 32 | Inflect::SETTER_PREFIX => $this->setter($method, $args), |
| 33 | 33 | Inflect::ISSER_PREFIX => $this->isser($method), |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | protected function getPropertyType(string $property): string |
| 144 | 144 | { |
| 145 | 145 | $p = new ReflectionProperty($this, $property); |
| 146 | - return $p->getType()?->getName(); |
|
| 146 | + return $p->getType() ? ->getName(); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | protected function normalizeValue(string $property, string $type, mixed $raw_value): mixed |