Passed
Push — main ( f251de...af650d )
by Diego
03:20
created
src/Repository/Projects/WikiPages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Factory/MetaFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Exception/Api/AbstractApiException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,11 +52,11 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Repository/CacheableRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Collection/HierarchyCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Model/ModelTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@
 block discarded – undo
141 141
     protected function getPropertyType(string $property): string
142 142
     {
143 143
         $p = new ReflectionProperty($this, $property);
144
-        return $p->getType()?->getName();
144
+        return $p->getType() ? ->getName();
145 145
     }
146 146
 
147 147
     protected function normalizeValue(string $property, string $type, mixed $raw_value): mixed
Please login to merge, or discard this patch.
src/Repository/Projects/Projects.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
src/Repository/Issues/Issues.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
src/Tool/Inflect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@
 block discarded – undo
173 173
 
174 174
     public static function extractPrefix(string $method): string
175 175
     {
176
-        preg_match( '/[A-Z]/', $method, $matches, PREG_OFFSET_CAPTURE );
176
+        preg_match('/[A-Z]/', $method, $matches, PREG_OFFSET_CAPTURE);
177 177
         return substr($method, 0, $matches[0][1]);
178 178
     }
179 179
 
Please login to merge, or discard this patch.