Passed
Push — main ( 788641...5bbbb9 )
by Diego
02:40
created
src/Mutator/Mutation/AddSubkeyMutation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         }
18 18
 
19 19
         if (is_object($target[$key])) {
20
-            $getter = "get" . Inflect::camelize(ucfirst((string)$subkey));
20
+            $getter = "get" . Inflect::camelize(ucfirst((string) $subkey));
21 21
             if (method_exists($target[$key], $getter)) {
22 22
                 $target[$key][$subkey] = $target[$key]->$getter();
23 23
             }
Please login to merge, or discard this patch.
src/Collection/IdentityCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     {
16 16
         $ret = [];
17 17
 
18
-        $elements =  parent::toArray();
18
+        $elements = parent::toArray();
19 19
         foreach ($elements as $identity) {
20 20
             $ret[] = $identity->toArray();
21 21
         }
Please login to merge, or discard this patch.
src/Client/Response/ApiResponse.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
     public static function fromRequestsResponse(Requests_Response $response, bool $is_cached = false): self
22 22
     {
23 23
         $data = ($response->body !== '' && str_contains((string) $response->headers->getValues("Content-Type")[0], "application/json")) ?
24
-            json_decode($response->body, true, 512, JSON_THROW_ON_ERROR) :
25
-            [];
24
+            json_decode($response->body, true, 512, JSON_THROW_ON_ERROR) : [];
26 25
 
27 26
         $ret = new self(
28 27
             $response->status_code,
Please login to merge, or discard this patch.
src/Client/Client.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
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),
Please login to merge, or discard this patch.
src/Tool/Inflect.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -153,8 +153,7 @@
 block discarded – undo
153 153
         $ret = $matches[0];
154 154
         foreach ($ret as &$match) {
155 155
             $match = $match === strtoupper($match) ?
156
-                strtolower($match) :
157
-                lcfirst($match);
156
+                strtolower($match) : lcfirst($match);
158 157
         }
159 158
         return implode('_', $ret);
160 159
     }
Please login to merge, or discard this patch.
src/Exception/Api/AbstractApiException.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,12 +51,12 @@
 block discarded – undo
51 51
 
52 52
     public static function fromApiResponse(ApiResponse $api_response, ?Throwable $previous = null): AbstractApiException | Error
53 53
     {
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),
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),
60 60
         };
61 61
     }
62 62
 }
Please login to merge, or discard this patch.
src/Repository/SearchableTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                 case RepositoryInterface::SEARCH_PARAM_TYPE_STRING:
197 197
                 case RepositoryInterface::SEARCH_PARAM_TYPE_BOOL:
198 198
                 default:
199
-                    $params[$parameter_name] =  $raw_value;
199
+                    $params[$parameter_name] = $raw_value;
200 200
                     break;
201 201
                 case RepositoryInterface::SEARCH_PARAM_TYPE_INT_ARRAY:
202 202
                 case RepositoryInterface::SEARCH_PARAM_TYPE_STRING_ARRAY:
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $ordering = [];
222 222
             foreach (static::$sort_params as $field => $direction) {
223 223
                 if ($direction === RepositoryInterface::SORT_DIRECTION_DESC) {
224
-                    $ordering[] = $field  . ":" . $direction;
224
+                    $ordering[] = $field . ":" . $direction;
225 225
                 } else {
226 226
                     $ordering[] = $field;
227 227
                 }
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
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Repository/Issues/Statuses.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,26 +21,26 @@
 block discarded – undo
21 21
 
22 22
     public function get(mixed $id): ?AbstractModel
23 23
     {
24
-        throw new Error("Method "  . __FUNCTION__ . " not implemented for apì: " . self::API_ROOT);
24
+        throw new Error("Method " . __FUNCTION__ . " not implemented for apì: " . self::API_ROOT);
25 25
     }
26 26
 
27 27
     public function search(array $params = []): ArrayCollection
28 28
     {
29
-        throw new Error("Method "  . __FUNCTION__ . "not implemented for apì: " . self::API_ROOT);
29
+        throw new Error("Method " . __FUNCTION__ . "not implemented for apì: " . self::API_ROOT);
30 30
     }
31 31
 
32 32
     public function create(AbstractModel $model): ?AbstractModel
33 33
     {
34
-        throw new Error("Method "  . __FUNCTION__ . " not implemented for apì: " . self::API_ROOT);
34
+        throw new Error("Method " . __FUNCTION__ . " not implemented for apì: " . self::API_ROOT);
35 35
     }
36 36
 
37 37
     public function update(AbstractModel $model): ?AbstractModel
38 38
     {
39
-        throw new Error("Method "  . __FUNCTION__ . " not implemented for apì: " . self::API_ROOT);
39
+        throw new Error("Method " . __FUNCTION__ . " not implemented for apì: " . self::API_ROOT);
40 40
     }
41 41
 
42 42
     public function delete(AbstractModel $model): void
43 43
     {
44
-        throw new Error("Method "  . __FUNCTION__ . " not implemented for apì: " . self::API_ROOT);
44
+        throw new Error("Method " . __FUNCTION__ . " not implemented for apì: " . self::API_ROOT);
45 45
     }
46 46
 }
Please login to merge, or discard this patch.