Completed
Push — develop ( b4cdc6...ec64f2 )
by Neomerx
04:50
created
src/Http/Traits/FluteRoutesTrait.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
         assert(array_key_exists(SchemaInterface::class, class_implements($schemeClass)) === true);
54 54
         $type = $schemeClass::TYPE;
55 55
 
56
-        $indexSlug = '/{' . CI::ROUTE_KEY_INDEX . '}';
57
-        $params    = function ($method) use ($type) {
58
-            return [RouteInterface::PARAM_NAME => $type . '_' . $method];
56
+        $indexSlug = '/{'.CI::ROUTE_KEY_INDEX.'}';
57
+        $params    = function($method) use ($type) {
58
+            return [RouteInterface::PARAM_NAME => $type.'_'.$method];
59 59
         };
60
-        $handler   = function ($method) use ($controllerClass) {
60
+        $handler   = function($method) use ($controllerClass) {
61 61
             return [$controllerClass, $method];
62 62
         };
63 63
 
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
             $group->post($type, $handler(CI::METHOD_CREATE), $params(CI::METHOD_CREATE));
71 71
         }
72 72
         if (in_array(ControllerReadInterface::class, $classInterfaces) === true) {
73
-            $group->get($type . $indexSlug, $handler(CI::METHOD_READ), $params(CI::METHOD_READ));
73
+            $group->get($type.$indexSlug, $handler(CI::METHOD_READ), $params(CI::METHOD_READ));
74 74
         }
75 75
         if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) {
76
-            $group->patch($type . $indexSlug, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE));
76
+            $group->patch($type.$indexSlug, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE));
77 77
         }
78 78
         if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) {
79
-            $group->delete($type . $indexSlug, $handler(CI::METHOD_DELETE), $params(CI::METHOD_DELETE));
79
+            $group->delete($type.$indexSlug, $handler(CI::METHOD_DELETE), $params(CI::METHOD_DELETE));
80 80
         }
81 81
 
82 82
         return $group;
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
      */
92 92
     protected static function controller(GroupInterface $group, string $subUri, string $controllerClass): GroupInterface
93 93
     {
94
-        $slugged = $subUri . '/{' . CI::ROUTE_KEY_INDEX . '}';
95
-        $params  = function ($method) use ($subUri) {
96
-            return [RouteInterface::PARAM_NAME => $subUri . '_' . $method];
94
+        $slugged = $subUri.'/{'.CI::ROUTE_KEY_INDEX.'}';
95
+        $params  = function($method) use ($subUri) {
96
+            return [RouteInterface::PARAM_NAME => $subUri.'_'.$method];
97 97
         };
98
-        $handler = function ($method) use ($controllerClass) {
98
+        $handler = function($method) use ($controllerClass) {
99 99
             return [$controllerClass, $method];
100 100
         };
101 101
 
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
             $group->get($slugged, $handler(CI::METHOD_READ), $params(CI::METHOD_READ));
113 113
         }
114 114
         if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) {
115
-            $updateUri = $slugged . '/' . CI::METHOD_UPDATE;
115
+            $updateUri = $slugged.'/'.CI::METHOD_UPDATE;
116 116
             $group->post($updateUri, $handler(CI::METHOD_UPDATE), $params(CI::METHOD_UPDATE));
117 117
         }
118 118
         if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) {
119
-            $deleteUri = $slugged . '/' . CI::METHOD_DELETE;
119
+            $deleteUri = $slugged.'/'.CI::METHOD_DELETE;
120 120
             $group->post($deleteUri, $handler(CI::METHOD_DELETE), $params(CI::METHOD_DELETE));
121 121
         }
122 122
 
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
         /** @var string $controllerClass */
149 149
         /** @var string $schemaClass */
150 150
 
151
-        $resourceIdUri = $subUri . '/{' . CI::ROUTE_KEY_INDEX . '}/';
152
-        $selfUri       = $resourceIdUri . DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName;
151
+        $resourceIdUri = $subUri.'/{'.CI::ROUTE_KEY_INDEX.'}/';
152
+        $selfUri       = $resourceIdUri.DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName;
153 153
 
154 154
         return $group
155 155
             // `self`
156 156
             ->get($selfUri, [$controllerClass, $selfGetMethod])
157 157
             // `related`
158
-            ->get($resourceIdUri . $relationshipName, [$controllerClass, $selfGetMethod]);
158
+            ->get($resourceIdUri.$relationshipName, [$controllerClass, $selfGetMethod]);
159 159
     }
160 160
 }
Please login to merge, or discard this patch.
src/Adapters/PaginationStrategy.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
     /**
69 69
      * @inheritdoc
70 70
      */
71
-    public function parseParameters(?array $parameters): array
71
+    public function parseParameters(? array $parameters) : array
72 72
     {
73 73
         if ($parameters === null) {
74 74
             return [0, $this->getDefaultPageSize()];
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             0,
82 82
             PHP_INT_MAX
83 83
         );
84
-        $size   = $this->getValue(
84
+        $size = $this->getValue(
85 85
             $parameters,
86 86
             static::PARAM_PAGING_SIZE,
87 87
             $this->getDefaultPageSize(),
Please login to merge, or discard this patch.
src/Schema/Schema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -208,12 +208,12 @@
 block discarded – undo
208 208
             return [static::DATA => $data->getData()];
209 209
         }
210 210
 
211
-        $buildUrl = function ($offset) use ($data, $uri) {
211
+        $buildUrl = function($offset) use ($data, $uri) {
212 212
             $paramsWithPaging = [
213 213
                 PaginationStrategyInterface::PARAM_PAGING_SKIP => $offset,
214 214
                 PaginationStrategyInterface::PARAM_PAGING_SIZE => $data->getLimit(),
215 215
             ];
216
-            $fullUrl          = $uri . '?' . http_build_query($paramsWithPaging);
216
+            $fullUrl = $uri.'?'.http_build_query($paramsWithPaging);
217 217
 
218 218
             return $fullUrl;
219 219
         };
Please login to merge, or discard this patch.
src/Http/BaseController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     ): ResponseInterface {
118 118
         $schemeParams = static::parseQueryParameters($container, $request->getQueryParams());
119 119
 
120
-        list ($filters, , $includes) =
120
+        list ($filters,, $includes) =
121 121
             static::mapSchemeToModelParameters($container, $schemeParams, static::SCHEMA_CLASS);
122 122
 
123 123
         $index    = $routeParams[static::ROUTE_KEY_INDEX];
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         ContainerInterface $container,
141 141
         ServerRequestInterface $request
142 142
     ): ResponseInterface {
143
-        $jsonData  = static::normalizeIndexValueOnUpdate(
143
+        $jsonData = static::normalizeIndexValueOnUpdate(
144 144
             $routeParams,
145 145
             $container,
146 146
             static::readJsonFromRequest($container, $request)
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
      */
268 268
     protected static function readJsonFromRequest(ContainerInterface $container, ServerRequestInterface $request): array
269 269
     {
270
-        $body = (string)$request->getBody();
270
+        $body = (string) $request->getBody();
271 271
         if (empty($body) === true || ($json = json_decode($body, true)) === null) {
272 272
             /** @var FactoryInterface $factory */
273 273
             $factory = $container->get(FactoryInterface::class);
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
     {
398 398
         assert(
399 399
             empty(static::ON_CREATE_VALIDATION_RULES_SET_CLASS) === false,
400
-            'Validation rules set should be defined for class ' . static::class . '.'
400
+            'Validation rules set should be defined for class '.static::class.'.'
401 401
         );
402 402
 
403 403
         return static::createJsonApiValidator($container, static::ON_CREATE_VALIDATION_RULES_SET_CLASS);
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
     {
413 413
         assert(
414 414
             empty(static::ON_UPDATE_VALIDATION_RULES_SET_CLASS) === false,
415
-            'Validation rules set should be defined for class ' . static::class . '.'
415
+            'Validation rules set should be defined for class '.static::class.'.'
416 416
         );
417 417
 
418 418
         return static::createJsonApiValidator($container, static::ON_UPDATE_VALIDATION_RULES_SET_CLASS);
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
         /** @var JsonSchemesInterface $jsonSchemes */
541 541
         $jsonSchemes  = $container->get(JsonSchemesInterface::class);
542 542
         $targetSchema = $jsonSchemes->getRelationshipSchema(static::SCHEMA_CLASS, $relationshipName);
543
-        list ($filters, $sorts, , $paging) =
543
+        list ($filters, $sorts,, $paging) =
544 544
             static::mapSchemeToModelParameters($container, $encodingParams, get_class($targetSchema));
545 545
 
546 546
         /** @var SchemaInterface $schemaClass */
Please login to merge, or discard this patch.
src/Package/FluteSettings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,8 @@
 block discarded – undo
108 108
         );
109 109
         assert(empty($validatorsFileMask) === false, "Invalid Validators file mask `$validatorsFileMask`.");
110 110
 
111
-        $schemesPath    = $schemesFolder . DIRECTORY_SEPARATOR . $schemesFileMask;
112
-        $validatorsPath = $validatorsFolder . DIRECTORY_SEPARATOR . $validatorsFileMask;
111
+        $schemesPath    = $schemesFolder.DIRECTORY_SEPARATOR.$schemesFileMask;
112
+        $validatorsPath = $validatorsFolder.DIRECTORY_SEPARATOR.$validatorsFileMask;
113 113
 
114 114
         $requireUniqueTypes = $defaults[static::KEY_SCHEMES_REQUIRE_UNIQUE_TYPES] ?? true;
115 115
 
Please login to merge, or discard this patch.