Passed
Push — main ( ac46d3...40b327 )
by Diego
03:35
created
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/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/CacheableRepository.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
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
 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
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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()) {
Please login to merge, or discard this patch.
src/Model/ModelTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.