@@ -42,7 +42,7 @@ |
||
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 |
@@ -132,7 +132,7 @@ discard block |
||
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 |
||
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 |
||
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 | { |
@@ -48,7 +48,7 @@ discard block |
||
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 |
||
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 | } |
@@ -408,7 +408,7 @@ |
||
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 | { |
@@ -245,7 +245,7 @@ discard block |
||
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 |
||
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 | } |
@@ -264,7 +264,7 @@ |
||
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 | { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | ContainerInterface $container, |
139 | 139 | ServerRequestInterface $request |
140 | 140 | ): ResponseInterface { |
141 | - $jsonData = static::normalizeIndexValueOnUpdate( |
|
141 | + $jsonData = static::normalizeIndexValueOnUpdate( |
|
142 | 142 | $routeParams, |
143 | 143 | $container, |
144 | 144 | static::readJsonFromRequest($container, $request) |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | protected static function readJsonFromRequest(ContainerInterface $container, ServerRequestInterface $request): array |
237 | 237 | { |
238 | - $body = (string)$request->getBody(); |
|
238 | + $body = (string) $request->getBody(); |
|
239 | 239 | if (empty($body) === true || ($json = json_decode($body, true)) === null) { |
240 | 240 | /** @var FactoryInterface $factory */ |
241 | 241 | $factory = $container->get(FactoryInterface::class); |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | { |
366 | 366 | assert( |
367 | 367 | empty(static::ON_CREATE_VALIDATION_RULES_SET_CLASS) === false, |
368 | - 'Validation rules set should be defined for class ' . static::class . '.' |
|
368 | + 'Validation rules set should be defined for class '.static::class.'.' |
|
369 | 369 | ); |
370 | 370 | |
371 | 371 | return static::createJsonApiValidator($container, static::ON_CREATE_VALIDATION_RULES_SET_CLASS); |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | { |
381 | 381 | assert( |
382 | 382 | empty(static::ON_UPDATE_VALIDATION_RULES_SET_CLASS) === false, |
383 | - 'Validation rules set should be defined for class ' . static::class . '.' |
|
383 | + 'Validation rules set should be defined for class '.static::class.'.' |
|
384 | 384 | ); |
385 | 385 | |
386 | 386 | return static::createJsonApiValidator($container, static::ON_UPDATE_VALIDATION_RULES_SET_CLASS); |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $mapper = static::createParameterMapper($container); |
520 | 520 | $api = static::createApi($container); |
521 | 521 | |
522 | - $relData = $mapper->applyQueryParameters($parser, $api) |
|
522 | + $relData = $mapper->applyQueryParameters($parser, $api) |
|
523 | 523 | ->withFilters([$modelClass::FIELD_ID => [FilterParameterInterface::OPERATION_EQUALS => [$index]]]) |
524 | 524 | ->readRelationship($relationshipName); |
525 | 525 |
@@ -118,7 +118,7 @@ |
||
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 |
@@ -49,22 +49,22 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |