Completed
Push — develop ( 323919...323bfc )
by Neomerx
15:34 queued 11:51
created
src/Http/ThrowableHandlers/FluteThrowableHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Http\ThrowableHandlers;
4 4
 
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
             $details  = null;
133 133
             if ($this->isDebug === true) {
134 134
                 $message = $throwable->getMessage();
135
-                $details = (string)$throwable;
135
+                $details = (string) $throwable;
136 136
             }
137
-            $errors->add(new Error(null, null, null, (string)$httpCode, null, $message, $details));
137
+            $errors->add(new Error(null, null, null, (string) $httpCode, null, $message, $details));
138 138
         }
139 139
 
140 140
         // encode the error and send to client
Please login to merge, or discard this patch.
src/Http/JsonApiBaseController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Http;
4 4
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
         $response = static::defaultCreateHandler(
94 94
             $request->getUri(),
95
-            (string)$request->getBody(),
95
+            (string) $request->getBody(),
96 96
             static::SCHEMA_CLASS,
97 97
             $container->get(ModelSchemaInfoInterface::class),
98 98
             static::defaultCreateDataParser($container, static::ON_CREATE_DATA_VALIDATION_RULES_CLASS),
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         static::assertClassValueDefined(static::ON_READ_QUERY_VALIDATION_RULES_CLASS);
120 120
 
121 121
         return static::defaultReadHandler(
122
-            (string)$routeParams[static::ROUTE_KEY_INDEX],
122
+            (string) $routeParams[static::ROUTE_KEY_INDEX],
123 123
             $request->getQueryParams(),
124 124
             $request->getUri(),
125 125
             static::defaultCreateQueryParser($container, static::ON_READ_QUERY_VALIDATION_RULES_CLASS),
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
         static::assertClassValueDefined(static::ON_UPDATE_DATA_VALIDATION_RULES_CLASS);
143 143
 
144 144
         $response = static::defaultUpdateHandler(
145
-            (string)$routeParams[static::ROUTE_KEY_INDEX],
145
+            (string) $routeParams[static::ROUTE_KEY_INDEX],
146 146
             $request->getUri(),
147
-            (string)$request->getBody(),
147
+            (string) $request->getBody(),
148 148
             static::SCHEMA_CLASS,
149 149
             $container->get(ModelSchemaInfoInterface::class),
150 150
             static::defaultCreateDataParser($container, static::ON_UPDATE_DATA_VALIDATION_RULES_CLASS),
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         static::assertClassValueDefined(static::API_CLASS);
169 169
 
170 170
         $response = static::defaultDeleteHandler(
171
-            (string)$routeParams[static::ROUTE_KEY_INDEX],
171
+            (string) $routeParams[static::ROUTE_KEY_INDEX],
172 172
             $request->getUri(),
173 173
             static::defaultCreateQueryParser($container, static::ON_READ_QUERY_VALIDATION_RULES_CLASS),
174 174
             static::defaultCreateApi($container, static::API_CLASS),
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         static::assertClassValueDefined(static::SCHEMA_CLASS);
202 202
 
203 203
         $api     = static::defaultCreateApi($container, static::API_CLASS);
204
-        $handler = function () use ($api, $index, $modelRelName) {
204
+        $handler = function() use ($api, $index, $modelRelName) {
205 205
             return $api->readRelationship($index, $modelRelName);
206 206
         };
207 207
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         static::assertClassValueDefined(static::SCHEMA_CLASS);
241 241
 
242 242
         $api     = static::defaultCreateApi($container, static::API_CLASS);
243
-        $handler = function () use ($api, $index, $modelRelName) {
243
+        $handler = function() use ($api, $index, $modelRelName) {
244 244
             return $api->readRelationship($index, $modelRelName);
245 245
         };
246 246
 
Please login to merge, or discard this patch.
src/Http/Traits/FluteRoutesTrait.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Http\Traits;
4 4
 
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
         assert(class_exists($controllerClass) === true);
51 51
 
52 52
         $groupPrefix = $group->getUriPrefix();
53
-        $indexSlug   = '/{' . JCI::ROUTE_KEY_INDEX . '}';
54
-        $params      = function (string $method) use ($groupPrefix, $resourceName): array {
53
+        $indexSlug   = '/{'.JCI::ROUTE_KEY_INDEX.'}';
54
+        $params      = function(string $method) use ($groupPrefix, $resourceName): array {
55 55
             return [RouteInterface::PARAM_NAME => static::routeName($groupPrefix, $resourceName, $method)];
56 56
         };
57
-        $handler     = function (string $method) use ($controllerClass): array {
57
+        $handler     = function(string $method) use ($controllerClass): array {
58 58
             return [$controllerClass, $method];
59 59
         };
60 60
 
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
             $group->post($resourceName, $handler(JCI::METHOD_CREATE), $params(JCI::METHOD_CREATE));
68 68
         }
69 69
         if (in_array(ControllerReadInterface::class, $classInterfaces) === true) {
70
-            $group->get($resourceName . $indexSlug, $handler(JCI::METHOD_READ), $params(JCI::METHOD_READ));
70
+            $group->get($resourceName.$indexSlug, $handler(JCI::METHOD_READ), $params(JCI::METHOD_READ));
71 71
         }
72 72
         if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) {
73
-            $group->patch($resourceName . $indexSlug, $handler(JCI::METHOD_UPDATE), $params(JCI::METHOD_UPDATE));
73
+            $group->patch($resourceName.$indexSlug, $handler(JCI::METHOD_UPDATE), $params(JCI::METHOD_UPDATE));
74 74
         }
75 75
         if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) {
76
-            $group->delete($resourceName . $indexSlug, $handler(JCI::METHOD_DELETE), $params(JCI::METHOD_DELETE));
76
+            $group->delete($resourceName.$indexSlug, $handler(JCI::METHOD_DELETE), $params(JCI::METHOD_DELETE));
77 77
         }
78 78
 
79 79
         return $group;
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
         }
100 100
 
101 101
         $groupPrefix = $group->getUriPrefix();
102
-        $slugged     = $subUri . '/{' . FCI::ROUTE_KEY_INDEX . '}';
103
-        $params      = function (string $method) use ($groupPrefix, $subUri) : array {
102
+        $slugged     = $subUri.'/{'.FCI::ROUTE_KEY_INDEX.'}';
103
+        $params      = function(string $method) use ($groupPrefix, $subUri) : array {
104 104
             return [RouteInterface::PARAM_NAME => static::routeName($groupPrefix, $subUri, $method)];
105 105
         };
106
-        $handler     = function (string $method) use ($controllerClass): array {
106
+        $handler     = function(string $method) use ($controllerClass): array {
107 107
             return [$controllerClass, $method];
108 108
         };
109 109
 
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
             $group->get($subUri, $handler(FCI::METHOD_INDEX), $params(FCI::METHOD_INDEX));
115 115
         }
116 116
         if (in_array(ControllerInstanceInterface::class, $classInterfaces) === true) {
117
-            $group->get($subUri . $createSubUrl, $handler(FCI::METHOD_INSTANCE), $params(FCI::METHOD_INSTANCE));
117
+            $group->get($subUri.$createSubUrl, $handler(FCI::METHOD_INSTANCE), $params(FCI::METHOD_INSTANCE));
118 118
         }
119 119
         if (in_array(ControllerCreateInterface::class, $classInterfaces) === true) {
120
-            $group->post($subUri . $createSubUrl, $handler(FCI::METHOD_CREATE), $params(FCI::METHOD_CREATE));
120
+            $group->post($subUri.$createSubUrl, $handler(FCI::METHOD_CREATE), $params(FCI::METHOD_CREATE));
121 121
         }
122 122
         if (in_array(ControllerReadInterface::class, $classInterfaces) === true) {
123 123
             $group->get($slugged, $handler(FCI::METHOD_READ), $params(FCI::METHOD_READ));
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             $group->post($slugged, $handler(FCI::METHOD_UPDATE), $params(FCI::METHOD_UPDATE));
127 127
         }
128 128
         if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) {
129
-            $deleteUri = $slugged . '/' . FCI::METHOD_DELETE;
129
+            $deleteUri = $slugged.'/'.FCI::METHOD_DELETE;
130 130
             $group->post($deleteUri, $handler(FCI::METHOD_DELETE), $params(FCI::METHOD_DELETE));
131 131
         }
132 132
 
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
         string $controllerClass,
150 150
         string $selfGetMethod
151 151
     ): GroupInterface {
152
-        $resourceIdUri = $resourceName . '/{' . JCI::ROUTE_KEY_INDEX . '}/';
153
-        $selfUri       = $resourceIdUri . DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName;
152
+        $resourceIdUri = $resourceName.'/{'.JCI::ROUTE_KEY_INDEX.'}/';
153
+        $selfUri       = $resourceIdUri.DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName;
154 154
 
155 155
         return $group
156 156
             // `self`
157 157
             ->get($selfUri, [$controllerClass, $selfGetMethod])
158 158
             // `related`
159
-            ->get($resourceIdUri . $relationshipName, [$controllerClass, $selfGetMethod]);
159
+            ->get($resourceIdUri.$relationshipName, [$controllerClass, $selfGetMethod]);
160 160
     }
161 161
 
162 162
     /**
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
         string $controllerClass,
176 176
         string $addMethod
177 177
     ): GroupInterface {
178
-        $url = $resourceName . '/{' . JCI::ROUTE_KEY_INDEX . '}/' .
179
-            DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName;
178
+        $url = $resourceName.'/{'.JCI::ROUTE_KEY_INDEX.'}/'.
179
+            DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName;
180 180
 
181 181
         return $group->post($url, [$controllerClass, $addMethod]);
182 182
     }
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
         string $controllerClass,
198 198
         string $deleteMethod
199 199
     ): GroupInterface {
200
-        $url = $resourceName . '/{' . JCI::ROUTE_KEY_INDEX . '}/' .
201
-            DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName;
200
+        $url = $resourceName.'/{'.JCI::ROUTE_KEY_INDEX.'}/'.
201
+            DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName;
202 202
 
203 203
         return $group->delete($url, [$controllerClass, $deleteMethod]);
204 204
     }
@@ -224,6 +224,6 @@  discard block
 block discarded – undo
224 224
             $subUri = substr($subUri, 0, -1);
225 225
         }
226 226
 
227
-        return $prefix . $subUri . '::' . $method;
227
+        return $prefix.$subUri.'::'.$method;
228 228
     }
229 229
 }
Please login to merge, or discard this patch.
src/Http/Query/Relationship.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Http\Query;
4 4
 
Please login to merge, or discard this patch.
src/Http/Query/ParametersMapper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Http\Query;
4 4
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     public function getMappedIncludes(): iterable
250 250
     {
251 251
         $fromSchema        = $this->getRootSchema();
252
-        $getMappedRelLinks = function (iterable $links) use ($fromSchema) : iterable {
252
+        $getMappedRelLinks = function(iterable $links) use ($fromSchema) : iterable {
253 253
             foreach ($links as $link) {
254 254
                 assert(is_string($link));
255 255
                 $fromSchemaClass = get_class($fromSchema);
@@ -299,14 +299,14 @@  discard block
 block discarded – undo
299 299
         //     ['rel2_name1', ],
300 300
         //     ['rel3_name1', 'rel3_name2', 'rel3_name3', ],
301 301
         // ]
302
-        $includeAsModelNames = function (iterable $relationships): iterable {
302
+        $includeAsModelNames = function(iterable $relationships): iterable {
303 303
             foreach ($relationships as $relationship) {
304 304
                 assert($relationship instanceof RelationshipInterface);
305 305
                 yield $relationship->getNameInModel();
306 306
             }
307 307
         };
308 308
         $mappedIncludes      = $this->getMappedIncludes();
309
-        $getIncludes         = function () use ($mappedIncludes, $includeAsModelNames) : iterable {
309
+        $getIncludes         = function() use ($mappedIncludes, $includeAsModelNames) : iterable {
310 310
             foreach ($mappedIncludes as $relationships) {
311 311
                 yield $includeAsModelNames($relationships);
312 312
             }
Please login to merge, or discard this patch.
src/Http/JsonApiResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Http;
4 4
 
Please login to merge, or discard this patch.
src/Contracts/Http/WebControllerInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Contracts\Http;
4 4
 
Please login to merge, or discard this patch.
src/Contracts/Http/Query/AttributeInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Contracts\Http\Query;
4 4
 
Please login to merge, or discard this patch.
src/Contracts/Http/Controller/ControllerIndexInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Flute\Contracts\Http\Controller;
4 4
 
Please login to merge, or discard this patch.