Completed
Push — develop ( 9148fa...0fd0fb )
by Neomerx
01:54
created
src/Contracts/Http/Query/QueryParserInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
     public function areFiltersWithAnd(): bool;
43 43
 
44 44
     /**
45
-     * @return iterable
45
+     * @return \Generator
46 46
      */
47 47
     public function getFilters(): iterable;
48 48
 
Please login to merge, or discard this patch.
src/Http/Query/BaseQueryParser.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      * @param string|mixed $shouldBeString
133 133
      * @param string       $separator
134 134
      *
135
-     * @return iterable
135
+     * @return \Generator
136 136
      */
137 137
     protected function splitString(string $paramName, $shouldBeString, string $separator): iterable
138 138
     {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @param string|mixed $shouldBeString
151 151
      * @param string       $separator
152 152
      *
153
-     * @return iterable
153
+     * @return \Generator
154 154
      */
155 155
     protected function splitStringAndCheckNoEmpties(string $paramName, $shouldBeString, string $separator): iterable
156 156
     {
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      * @param string       $paramName
169 169
      * @param string|mixed $shouldBeString
170 170
      *
171
-     * @return iterable
171
+     * @return \Generator
172 172
      */
173 173
     protected function splitCommaSeparatedStringAndCheckNoEmpties(string $paramName, $shouldBeString): iterable
174 174
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public function __construct(array $parameters = [], array $messages = null)
49 49
     {
50 50
         $this->setParameters($parameters);
51
-        $this->messages   = $messages;
51
+        $this->messages = $messages;
52 52
     }
53 53
 
54 54
     /**
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
     public function getIncludes(): iterable
70 70
     {
71 71
         if (array_key_exists(static::PARAM_INCLUDE, $this->getParameters()) === true) {
72
-            $splitByDot = function (string $path): iterable {
72
+            $splitByDot = function(string $path): iterable {
73 73
                 foreach ($this->splitStringAndCheckNoEmpties(static::PARAM_INCLUDE, $path, '.') as $link) {
74 74
                     yield $link;
75 75
                 }
76 76
             };
77 77
 
78
-            $includes   = $this->getParameters()[static::PARAM_INCLUDE];
78
+            $includes = $this->getParameters()[static::PARAM_INCLUDE];
79 79
             foreach ($this->splitCommaSeparatedStringAndCheckNoEmpties(static::PARAM_INCLUDE, $includes) as $path) {
80 80
                 yield $path => $splitByDot($path);
81 81
             }
Please login to merge, or discard this patch.
src/Http/Query/ParametersMapper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -408,7 +408,7 @@
 block discarded – undo
408 408
      * @param string   $parameterName
409 409
      * @param iterable $value
410 410
      *
411
-     * @return iterable
411
+     * @return Generator
412 412
      */
413 413
     private function parseOperationsAndArguments(string $parameterName, iterable $value): iterable
414 414
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     public function getMappedIncludes(): iterable
246 246
     {
247 247
         $fromScheme        = $this->getRootScheme();
248
-        $getMappedRelLinks = function (iterable $links) use ($fromScheme) : iterable {
248
+        $getMappedRelLinks = function(iterable $links) use ($fromScheme) : iterable {
249 249
             foreach ($links as $link) {
250 250
                 assert(is_string($link));
251 251
                 $fromSchemaClass = get_class($fromScheme);
@@ -289,14 +289,14 @@  discard block
 block discarded – undo
289 289
         //     ['rel2_name1', ],
290 290
         //     ['rel3_name1', 'rel3_name2', 'rel3_name3', ],
291 291
         // ]
292
-        $includeAsModelNames = function (iterable $relationships): iterable {
292
+        $includeAsModelNames = function(iterable $relationships): iterable {
293 293
             foreach ($relationships as $relationship) {
294 294
                 assert($relationship instanceof RelationshipInterface);
295 295
                 yield $relationship->getNameInModel();
296 296
             }
297 297
         };
298
-        $mappedIncludes     = $this->getMappedIncludes();
299
-        $getIncludes         = function () use ($mappedIncludes, $includeAsModelNames) : iterable {
298
+        $mappedIncludes = $this->getMappedIncludes();
299
+        $getIncludes = function() use ($mappedIncludes, $includeAsModelNames) : iterable {
300 300
             foreach ($mappedIncludes as $relationships) {
301 301
                 yield $includeAsModelNames($relationships);
302 302
             }
Please login to merge, or discard this patch.
src/Http/Query/QueryParser.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@
 block discarded – undo
264 264
      * @param string $parameterName
265 265
      * @param array  $value
266 266
      *
267
-     * @return iterable
267
+     * @return Generator
268 268
      */
269 269
     private function parseOperationsAndArguments(string $parameterName, array $value): iterable
270 270
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public function withAllowedFilterFields(array $fields): QueryParserInterface
92 92
     {
93 93
         // debug check all fields are strings
94
-        assert((function () use ($fields) {
94
+        assert((function() use ($fields) {
95 95
                 $allAreStrings = !empty($fields);
96 96
                 foreach ($fields as $field) {
97 97
                     $allAreStrings = $allAreStrings === true && is_string($field) === true && empty($field) === false;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     public function withAllowedSortFields(array $fields): QueryParserInterface
132 132
     {
133 133
         // debug check all fields are strings
134
-        assert((function () use ($fields) {
134
+        assert((function() use ($fields) {
135 135
                 $allAreStrings = !empty($fields);
136 136
                 foreach ($fields as $field) {
137 137
                     $allAreStrings = $allAreStrings === true && is_string($field) === true && empty($field) === false;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function withAllowedIncludePaths(array $paths): QueryParserInterface
172 172
     {
173 173
         // debug check all fields are strings
174
-        assert((function () use ($paths) {
174
+        assert((function() use ($paths) {
175 175
                 $allAreStrings = !empty($paths);
176 176
                 foreach ($paths as $path) {
177 177
                     $allAreStrings = $allAreStrings === true && is_string($path) === true && empty($path) === false;
Please login to merge, or discard this patch.
src/Contracts/Api/CrudInterface.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
      *
119 119
      * @return array|null
120 120
      */
121
-    public function fetchRow(QueryBuilder $builder = null, string $modelClass = null): ?array;
121
+    public function fetchRow(QueryBuilder $builder = null, string $modelClass = null): ? array;
122 122
 
123 123
     /**
124 124
      * @return PaginatedDataInterface
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@
 block discarded – undo
181 181
     ): PaginatedDataInterface;
182 182
 
183 183
     /**
184
-     * @param int|string    $index
184
+     * @param string    $index
185 185
      * @param string        $name
186 186
      * @param iterable|null $relationshipFilters
187 187
      * @param iterable|null $relationshipSorts
Please login to merge, or discard this patch.
src/Package/FluteContainerConfigurator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,22 +49,22 @@  discard block
 block discarded – undo
49 49
 
50 50
         $container[FactoryInterface::class] = $factory;
51 51
 
52
-        $container[JsonSchemesInterface::class] = function (PsrContainerInterface $container) use ($factory) {
52
+        $container[JsonSchemesInterface::class] = function(PsrContainerInterface $container) use ($factory) {
53 53
             $settings     = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class);
54 54
             $modelSchemes = $container->get(ModelSchemeInfoInterface::class);
55 55
 
56 56
             return $factory->createJsonSchemes($settings[FluteSettings::KEY_MODEL_TO_SCHEME_MAP], $modelSchemes);
57 57
         };
58 58
 
59
-        $container[QueryParserInterface::class] = function (PsrContainerInterface $container) {
59
+        $container[QueryParserInterface::class] = function(PsrContainerInterface $container) {
60 60
             return new QueryParser($container->get(PaginationStrategyInterface::class));
61 61
         };
62 62
 
63
-        $container[ParametersMapperInterface::class] = function (PsrContainerInterface $container) {
63
+        $container[ParametersMapperInterface::class] = function(PsrContainerInterface $container) {
64 64
             return new ParametersMapper($container->get(JsonSchemesInterface::class));
65 65
         };
66 66
 
67
-        $container[EncoderInterface::class] = function (PsrContainerInterface $container) use ($factory) {
67
+        $container[EncoderInterface::class] = function(PsrContainerInterface $container) use ($factory) {
68 68
             /** @var JsonSchemesInterface $jsonSchemes */
69 69
             $jsonSchemes = $container->get(JsonSchemesInterface::class);
70 70
             $settings    = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             return $encoder;
80 80
         };
81 81
 
82
-        $container[PaginationStrategyInterface::class] = function (PsrContainerInterface $container) {
82
+        $container[PaginationStrategyInterface::class] = function(PsrContainerInterface $container) {
83 83
             $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class);
84 84
 
85 85
             return new PaginationStrategy(
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             );
89 89
         };
90 90
 
91
-        $container[JsonApiValidatorFactoryInterface::class] = function (PsrContainerInterface $container) {
91
+        $container[JsonApiValidatorFactoryInterface::class] = function(PsrContainerInterface $container) {
92 92
             $factory = new JsonApiValidatorFactory($container);
93 93
 
94 94
             return $factory;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public static function configureExceptionHandler(LimoncelloContainerInterface $container)
118 118
     {
119
-        $container[ThrowableHandlerInterface::class] = function (PsrContainerInterface $container) {
119
+        $container[ThrowableHandlerInterface::class] = function(PsrContainerInterface $container) {
120 120
             $appSettings   = $container->get(SettingsProviderInterface::class)->get(A::class);
121 121
             $fluteSettings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class);
122 122
 
Please login to merge, or discard this patch.
src/Http/BaseController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         ContainerInterface $container,
140 140
         ServerRequestInterface $request
141 141
     ): ResponseInterface {
142
-        $jsonData  = static::normalizeIndexValueOnUpdate(
142
+        $jsonData = static::normalizeIndexValueOnUpdate(
143 143
             $routeParams,
144 144
             $container,
145 145
             static::readJsonFromRequest($container, $request)
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
      */
247 247
     protected static function readJsonFromRequest(ContainerInterface $container, ServerRequestInterface $request): array
248 248
     {
249
-        $body = (string)$request->getBody();
249
+        $body = (string) $request->getBody();
250 250
         if (empty($body) === true || ($json = json_decode($body, true)) === null) {
251 251
             /** @var FactoryInterface $factory */
252 252
             $factory = $container->get(FactoryInterface::class);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
     {
377 377
         assert(
378 378
             empty(static::ON_CREATE_VALIDATION_RULES_SET_CLASS) === false,
379
-            'Validation rules set should be defined for class ' . static::class . '.'
379
+            'Validation rules set should be defined for class '.static::class.'.'
380 380
         );
381 381
 
382 382
         return static::createJsonApiValidator($container, static::ON_CREATE_VALIDATION_RULES_SET_CLASS);
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     {
392 392
         assert(
393 393
             empty(static::ON_UPDATE_VALIDATION_RULES_SET_CLASS) === false,
394
-            'Validation rules set should be defined for class ' . static::class . '.'
394
+            'Validation rules set should be defined for class '.static::class.'.'
395 395
         );
396 396
 
397 397
         return static::createJsonApiValidator($container, static::ON_UPDATE_VALIDATION_RULES_SET_CLASS);
Please login to merge, or discard this patch.