@@ -99,7 +99,7 @@ |
||
99 | 99 | $details = null; |
100 | 100 | if ($this->isDebug === true) { |
101 | 101 | $message = $throwable->getMessage(); |
102 | - $details = (string)$throwable; |
|
102 | + $details = (string) $throwable; |
|
103 | 103 | } |
104 | 104 | $errors->add(new Error(null, null, $httpCode, null, $message, $details)); |
105 | 105 | } |
@@ -52,17 +52,17 @@ |
||
52 | 52 | public function withIncludes(iterable $includes): self; |
53 | 53 | |
54 | 54 | /** |
55 | - * @return iterable |
|
55 | + * @return \Generator |
|
56 | 56 | */ |
57 | 57 | public function getMappedFilters(): iterable; |
58 | 58 | |
59 | 59 | /** |
60 | - * @return iterable |
|
60 | + * @return \Generator |
|
61 | 61 | */ |
62 | 62 | public function getMappedSorts(): iterable; |
63 | 63 | |
64 | 64 | /** |
65 | - * @return iterable |
|
65 | + * @return \Generator |
|
66 | 66 | */ |
67 | 67 | public function getMappedIncludes(): iterable; |
68 | 68 |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
174 | - * @param iterable $attributes |
|
174 | + * @param \Generator $attributes |
|
175 | 175 | * |
176 | 176 | * @return self |
177 | 177 | * |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
196 | - * @param iterable $attributes |
|
196 | + * @param \Generator $attributes |
|
197 | 197 | * |
198 | 198 | * @return self |
199 | 199 | * |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * @param string $modelClass |
217 | 217 | * @param iterable $attributes |
218 | 218 | * |
219 | - * @return iterable |
|
219 | + * @return \Generator |
|
220 | 220 | * |
221 | 221 | * @SuppressWarnings(PHPMD.StaticAccess) |
222 | 222 | * |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
318 | - * @param iterable $filters |
|
318 | + * @param \Limoncello\Flute\Api\iterable|null $filters |
|
319 | 319 | * |
320 | 320 | * @return self |
321 | 321 | * |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | } |
332 | 332 | |
333 | 333 | /** |
334 | - * @param iterable $filters |
|
334 | + * @param \Limoncello\Flute\Api\iterable|null $filters |
|
335 | 335 | * |
336 | 336 | * @return self |
337 | 337 | * |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | } |
348 | 348 | |
349 | 349 | /** |
350 | - * @param iterable $filters |
|
350 | + * @param \Limoncello\Flute\Api\iterable|null $filters |
|
351 | 351 | * |
352 | 352 | * @return self |
353 | 353 | * |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | /** |
393 | 393 | * @param string $relationshipName |
394 | - * @param iterable $relationshipFilters |
|
394 | + * @param \Limoncello\Flute\Api\iterable|null $relationshipFilters |
|
395 | 395 | * @param iterable|null $relationshipSorts |
396 | 396 | * |
397 | 397 | * @return self |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | } |
418 | 418 | |
419 | 419 | /** |
420 | - * @param iterable $sortParameters |
|
420 | + * @param \Limoncello\Flute\Api\iterable|null $sortParameters |
|
421 | 421 | * |
422 | 422 | * @return self |
423 | 423 | */ |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | foreach ($operationsWithArgs as $operation => $arguments) { |
531 | 531 | assert( |
532 | 532 | is_iterable($arguments) === true || is_array($arguments) === true, |
533 | - "Operation arguments are missing for `$columnName` column. " . |
|
533 | + "Operation arguments are missing for `$columnName` column. ". |
|
534 | 534 | 'Use an empty array as an empty argument list.' |
535 | 535 | ); |
536 | 536 | $expression->add($this->createFilterExpression($fullColumnName, $operation, $arguments)); |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | */ |
566 | 566 | public function buildColumnName(string $table, string $column): string |
567 | 567 | { |
568 | - return $this->quoteTableName($table) . '.' . $this->quoteColumnName($column); |
|
568 | + return $this->quoteTableName($table).'.'.$this->quoteColumnName($column); |
|
569 | 569 | } |
570 | 570 | |
571 | 571 | /** |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | */ |
608 | 608 | public function createAlias(string $tableName): string |
609 | 609 | { |
610 | - $alias = $tableName . (++$this->aliasIdCounter); |
|
610 | + $alias = $tableName.(++$this->aliasIdCounter); |
|
611 | 611 | $this->knownAliases[$tableName] = $alias; |
612 | 612 | |
613 | 613 | return $alias; |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | string $targetColumn |
662 | 662 | ): string { |
663 | 663 | $targetAlias = $this->createAlias($targetTable); |
664 | - $joinCondition = $this->buildColumnName($fromAlias, $fromColumn) . '=' . |
|
664 | + $joinCondition = $this->buildColumnName($fromAlias, $fromColumn).'='. |
|
665 | 665 | $this->buildColumnName($targetAlias, $targetColumn); |
666 | 666 | |
667 | 667 | $this->innerJoin( |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | } else { |
860 | 860 | assert( |
861 | 861 | $value !== null, |
862 | - 'It seems you are trying to use `null` with =, >, <, or etc operator. ' . |
|
862 | + 'It seems you are trying to use `null` with =, >, <, or etc operator. '. |
|
863 | 863 | 'Use `is null` or `not null` instead.' |
864 | 864 | ); |
865 | 865 | assert(is_string($value), "Only strings, booleans and integers are supported."); |
@@ -756,9 +756,9 @@ discard block |
||
756 | 756 | } |
757 | 757 | |
758 | 758 | /** |
759 | - * @param iterable $paths (string[]) |
|
759 | + * @param iterable|null $paths (string[]) |
|
760 | 760 | * |
761 | - * @return iterable |
|
761 | + * @return Generator |
|
762 | 762 | */ |
763 | 763 | private static function getPaths(iterable $paths): iterable |
764 | 764 | { |
@@ -1399,7 +1399,7 @@ discard block |
||
1399 | 1399 | * @param string $modelClass |
1400 | 1400 | * @param string $keyColumnName |
1401 | 1401 | * |
1402 | - * @return iterable |
|
1402 | + * @return Generator |
|
1403 | 1403 | * |
1404 | 1404 | * @throws DBALException |
1405 | 1405 | * |
@@ -1503,7 +1503,7 @@ discard block |
||
1503 | 1503 | * @param null|string $index |
1504 | 1504 | * @param iterable $attributes |
1505 | 1505 | * |
1506 | - * @return iterable |
|
1506 | + * @return Generator |
|
1507 | 1507 | */ |
1508 | 1508 | protected function filterAttributesOnCreate(?string $index, iterable $attributes): iterable |
1509 | 1509 | { |
@@ -1523,7 +1523,7 @@ discard block |
||
1523 | 1523 | /** |
1524 | 1524 | * @param iterable $attributes |
1525 | 1525 | * |
1526 | - * @return iterable |
|
1526 | + * @return Generator |
|
1527 | 1527 | */ |
1528 | 1528 | protected function filterAttributesOnUpdate(iterable $attributes): iterable |
1529 | 1529 | { |
@@ -1722,10 +1722,10 @@ discard block |
||
1722 | 1722 | |
1723 | 1723 | /** |
1724 | 1724 | * @param iterable $attributes |
1725 | - * @param array $typeNames |
|
1725 | + * @param Type[] $typeNames |
|
1726 | 1726 | * @param AbstractPlatform $platform |
1727 | 1727 | * |
1728 | - * @return iterable |
|
1728 | + * @return Generator |
|
1729 | 1729 | * |
1730 | 1730 | * @throws DBALException |
1731 | 1731 | */ |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | */ |
209 | 209 | public function withIndexesFilter(array $indexes): CrudInterface |
210 | 210 | { |
211 | - assert(call_user_func(function () use ($indexes) { |
|
211 | + assert(call_user_func(function() use ($indexes) { |
|
212 | 212 | $allOk = true; |
213 | 213 | |
214 | 214 | foreach ($indexes as $index) { |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | $classAtPath = new ArrayObject(); |
761 | 761 | $idsAtPath = new ArrayObject(); |
762 | 762 | |
763 | - $registerModelAtRoot = function ($model) use ($modelStorage, $modelsAtPath, $idsAtPath): void { |
|
763 | + $registerModelAtRoot = function($model) use ($modelStorage, $modelsAtPath, $idsAtPath): void { |
|
764 | 764 | self::registerModelAtPath( |
765 | 765 | $model, |
766 | 766 | static::ROOT_PATH, |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | assert(is_string($pathPiece)); |
849 | 849 | $parent = $tmpPath; |
850 | 850 | $tmpPath = empty($tmpPath) === true ? |
851 | - $pathPiece : $tmpPath . static::PATH_SEPARATOR . $pathPiece; |
|
851 | + $pathPiece : $tmpPath.static::PATH_SEPARATOR.$pathPiece; |
|
852 | 852 | $normalizedPaths[$tmpPath] = [$parent, $pathPiece]; |
853 | 853 | $pathsDepths[$parent] = $parentDepth++; |
854 | 854 | } |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | ): ModelQueryBuilder { |
1018 | 1018 | assert( |
1019 | 1019 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $relationshipName), |
1020 | - "Relationship `$relationshipName` do not exist in model `" . $this->getModelClass() . '`' |
|
1020 | + "Relationship `$relationshipName` do not exist in model `".$this->getModelClass().'`' |
|
1021 | 1021 | ); |
1022 | 1022 | |
1023 | 1023 | // as we read data from a relationship our main table and model would be the table/model in the relationship |
@@ -1036,8 +1036,7 @@ discard block |
||
1036 | 1036 | $filters = $this->getFilters(); |
1037 | 1037 | $sorts = $this->getSorts(); |
1038 | 1038 | $this->areFiltersWithAnd() ? |
1039 | - $builder->addRelationshipFiltersAndSortsWithAnd($reverseRelName, $filters, $sorts) : |
|
1040 | - $builder->addRelationshipFiltersAndSortsWithOr($reverseRelName, $filters, $sorts); |
|
1039 | + $builder->addRelationshipFiltersAndSortsWithAnd($reverseRelName, $filters, $sorts) : $builder->addRelationshipFiltersAndSortsWithOr($reverseRelName, $filters, $sorts); |
|
1041 | 1040 | } |
1042 | 1041 | // ... and the input filters to actual data we select |
1043 | 1042 | if ($relationshipFilters !== null) { |
@@ -1067,7 +1066,7 @@ discard block |
||
1067 | 1066 | ) { |
1068 | 1067 | assert( |
1069 | 1068 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $name), |
1070 | - "Relationship `$name` do not exist in model `" . $this->getModelClass() . '`' |
|
1069 | + "Relationship `$name` do not exist in model `".$this->getModelClass().'`' |
|
1071 | 1070 | ); |
1072 | 1071 | |
1073 | 1072 | // depending on the relationship type we expect the result to be either single resource or a collection |
@@ -1096,7 +1095,7 @@ discard block |
||
1096 | 1095 | ): array { |
1097 | 1096 | assert( |
1098 | 1097 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $name), |
1099 | - "Relationship `$name` do not exist in model `" . $this->getModelClass() . '`' |
|
1098 | + "Relationship `$name` do not exist in model `".$this->getModelClass().'`' |
|
1100 | 1099 | ); |
1101 | 1100 | |
1102 | 1101 | // depending on the relationship type we expect the result to be either single resource or a collection |
@@ -1172,7 +1171,7 @@ discard block |
||
1172 | 1171 | |
1173 | 1172 | $this->clearFetchParameters(); |
1174 | 1173 | |
1175 | - return (int)$deleted; |
|
1174 | + return (int) $deleted; |
|
1176 | 1175 | } |
1177 | 1176 | |
1178 | 1177 | /** |
@@ -1188,7 +1187,7 @@ discard block |
||
1188 | 1187 | |
1189 | 1188 | $this->clearFetchParameters(); |
1190 | 1189 | |
1191 | - return (int)$deleted > 0; |
|
1190 | + return (int) $deleted > 0; |
|
1192 | 1191 | } |
1193 | 1192 | |
1194 | 1193 | /** |
@@ -1213,7 +1212,7 @@ discard block |
||
1213 | 1212 | |
1214 | 1213 | $this->clearBuilderParameters()->clearFetchParameters(); |
1215 | 1214 | |
1216 | - $this->inTransaction(function () use ($saveMain, $toMany, &$index) { |
|
1215 | + $this->inTransaction(function() use ($saveMain, $toMany, &$index) { |
|
1217 | 1216 | $saveMain->execute(); |
1218 | 1217 | |
1219 | 1218 | // if no index given will use last insert ID as index |
@@ -1254,12 +1253,12 @@ discard block |
||
1254 | 1253 | ->createBuilder($this->getModelClass()) |
1255 | 1254 | ->updateModels($allowedChanges) |
1256 | 1255 | ->addFiltersWithAndToTable($filters); |
1257 | - $saveMain = $this->builderSaveResourceOnUpdate($saveMain); |
|
1256 | + $saveMain = $this->builderSaveResourceOnUpdate($saveMain); |
|
1258 | 1257 | $saveMain->getSQL(); // prepare |
1259 | 1258 | |
1260 | 1259 | $this->clearBuilderParameters()->clearFetchParameters(); |
1261 | 1260 | |
1262 | - $this->inTransaction(function () use ($saveMain, $toMany, $index, &$updated) { |
|
1261 | + $this->inTransaction(function() use ($saveMain, $toMany, $index, &$updated) { |
|
1263 | 1262 | $updated = $saveMain->execute(); |
1264 | 1263 | |
1265 | 1264 | $builderHook = Closure::fromCallable([$this, 'builderSaveRelationshipOnUpdate']); |
@@ -1275,7 +1274,7 @@ discard block |
||
1275 | 1274 | )->execute(); |
1276 | 1275 | |
1277 | 1276 | // add new ones |
1278 | - $updated += $this->addInToManyRelationship( |
|
1277 | + $updated += $this->addInToManyRelationship( |
|
1279 | 1278 | $connection, |
1280 | 1279 | $index, |
1281 | 1280 | $relationshipName, |
@@ -1285,7 +1284,7 @@ discard block |
||
1285 | 1284 | } |
1286 | 1285 | }); |
1287 | 1286 | |
1288 | - return (int)$updated; |
|
1287 | + return (int) $updated; |
|
1289 | 1288 | } |
1290 | 1289 | |
1291 | 1290 | /** |
@@ -1300,9 +1299,9 @@ discard block |
||
1300 | 1299 | public function createInBelongsToManyRelationship(string $parentId, string $name, iterable $childIds): int |
1301 | 1300 | { |
1302 | 1301 | // Check that relationship is `BelongsToMany` |
1303 | - assert(call_user_func(function () use ($name): bool { |
|
1302 | + assert(call_user_func(function() use ($name): bool { |
|
1304 | 1303 | $relType = $this->getModelSchemas()->getRelationshipType($this->getModelClass(), $name); |
1305 | - $errMsg = "Relationship `$name` of class `" . $this->getModelClass() . |
|
1304 | + $errMsg = "Relationship `$name` of class `".$this->getModelClass(). |
|
1306 | 1305 | '` either is not `belongsToMany` or do not exist in the class.'; |
1307 | 1306 | $isOk = $relType === RelationshipTypes::BELONGS_TO_MANY; |
1308 | 1307 | |
@@ -1324,9 +1323,9 @@ discard block |
||
1324 | 1323 | public function removeInBelongsToManyRelationship(string $parentId, string $name, iterable $childIds): int |
1325 | 1324 | { |
1326 | 1325 | // Check that relationship is `BelongsToMany` |
1327 | - assert(call_user_func(function () use ($name): bool { |
|
1326 | + assert(call_user_func(function() use ($name): bool { |
|
1328 | 1327 | $relType = $this->getModelSchemas()->getRelationshipType($this->getModelClass(), $name); |
1329 | - $errMsg = "Relationship `$name` of class `" . $this->getModelClass() . |
|
1328 | + $errMsg = "Relationship `$name` of class `".$this->getModelClass(). |
|
1330 | 1329 | '` either is not `belongsToMany` or do not exist in the class.'; |
1331 | 1330 | $isOk = $relType === RelationshipTypes::BELONGS_TO_MANY; |
1332 | 1331 | |
@@ -1494,7 +1493,7 @@ discard block |
||
1494 | 1493 | { |
1495 | 1494 | $countBuilder = $this->createBuilder($this->getModelClass()); |
1496 | 1495 | $countBuilder->setParameters($builder->getParameters()); |
1497 | - $countBuilder->select('COUNT(*)')->from('(' . $builder->getSQL() . ') AS RESULT'); |
|
1496 | + $countBuilder->select('COUNT(*)')->from('('.$builder->getSQL().') AS RESULT'); |
|
1498 | 1497 | |
1499 | 1498 | return $countBuilder; |
1500 | 1499 | } |
@@ -1526,7 +1525,7 @@ discard block |
||
1526 | 1525 | |
1527 | 1526 | foreach ($secondaryIdentities as $secondaryId) { |
1528 | 1527 | try { |
1529 | - $inserted += (int)$saveToMany->setParameter($secondaryIdBindName, $secondaryId)->execute(); |
|
1528 | + $inserted += (int) $saveToMany->setParameter($secondaryIdBindName, $secondaryId)->execute(); |
|
1530 | 1529 | } /** @noinspection PhpRedundantCatchClauseInspection */ catch (UcvException $exception) { |
1531 | 1530 | // Spec: If all of the specified resources can be added to, or are already present in, |
1532 | 1531 | // the relationship then the server MUST return a successful response. |
@@ -1773,7 +1772,7 @@ discard block |
||
1773 | 1772 | |
1774 | 1773 | $pkName = $this->getModelSchemas()->getPrimaryKey($parentClass); |
1775 | 1774 | |
1776 | - $registerModelAtPath = function ($model, string $path) use ($deDup, $modelsAtPath, $idsAtPath) { |
|
1775 | + $registerModelAtPath = function($model, string $path) use ($deDup, $modelsAtPath, $idsAtPath) { |
|
1777 | 1776 | return self::registerModelAtPath( |
1778 | 1777 | $model, |
1779 | 1778 | $path, |
@@ -1785,7 +1784,7 @@ discard block |
||
1785 | 1784 | }; |
1786 | 1785 | |
1787 | 1786 | foreach ($childRelationships as $name) { |
1788 | - $childrenPath = $parentsPath !== static::ROOT_PATH ? $parentsPath . static::PATH_SEPARATOR . $name : $name; |
|
1787 | + $childrenPath = $parentsPath !== static::ROOT_PATH ? $parentsPath.static::PATH_SEPARATOR.$name : $name; |
|
1789 | 1788 | |
1790 | 1789 | $relationshipType = $this->getModelSchemas()->getRelationshipType($parentClass, $name); |
1791 | 1790 | list ($targetModelClass, $reverseRelName) = |
@@ -1840,7 +1839,7 @@ discard block |
||
1840 | 1839 | [$pkName => [FilterParameterInterface::OPERATION_EQUALS => [$parent->{$pkName}]]], |
1841 | 1840 | [] |
1842 | 1841 | ); |
1843 | - $children = $this->fetchPaginatedResourcesWithoutRelationships( |
|
1842 | + $children = $this->fetchPaginatedResourcesWithoutRelationships( |
|
1844 | 1843 | $clonedBuilder, |
1845 | 1844 | $clonedBuilder->getModelClass() |
1846 | 1845 | ); |
@@ -409,7 +409,7 @@ |
||
409 | 409 | * @param string $parameterName |
410 | 410 | * @param iterable $value |
411 | 411 | * |
412 | - * @return iterable |
|
412 | + * @return Generator |
|
413 | 413 | * |
414 | 414 | * @SuppressWarnings(PHPMD.CyclomaticComplexity) |
415 | 415 | */ |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | public function getMappedIncludes(): iterable |
247 | 247 | { |
248 | 248 | $fromSchema = $this->getRootSchema(); |
249 | - $getMappedRelLinks = function (iterable $links) use ($fromSchema) : iterable { |
|
249 | + $getMappedRelLinks = function(iterable $links) use ($fromSchema) : iterable { |
|
250 | 250 | foreach ($links as $link) { |
251 | 251 | assert(is_string($link)); |
252 | 252 | $fromSchemaClass = get_class($fromSchema); |
@@ -296,14 +296,14 @@ discard block |
||
296 | 296 | // ['rel2_name1', ], |
297 | 297 | // ['rel3_name1', 'rel3_name2', 'rel3_name3', ], |
298 | 298 | // ] |
299 | - $includeAsModelNames = function (iterable $relationships): iterable { |
|
299 | + $includeAsModelNames = function(iterable $relationships): iterable { |
|
300 | 300 | foreach ($relationships as $relationship) { |
301 | 301 | assert($relationship instanceof RelationshipInterface); |
302 | 302 | yield $relationship->getNameInModel(); |
303 | 303 | } |
304 | 304 | }; |
305 | 305 | $mappedIncludes = $this->getMappedIncludes(); |
306 | - $getIncludes = function () use ($mappedIncludes, $includeAsModelNames) : iterable { |
|
306 | + $getIncludes = function() use ($mappedIncludes, $includeAsModelNames) : iterable { |
|
307 | 307 | foreach ($mappedIncludes as $relationships) { |
308 | 308 | yield $includeAsModelNames($relationships); |
309 | 309 | } |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | } |
380 | 380 | |
381 | 381 | /** |
382 | - * @return iterable |
|
382 | + * @return Generator |
|
383 | 383 | * |
384 | 384 | * @SuppressWarnings(PHPMD.ElseExpression) |
385 | 385 | */ |
@@ -421,9 +421,9 @@ discard block |
||
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
424 | - * @param iterable $fieldsFromParent |
|
424 | + * @param Generator $fieldsFromParent |
|
425 | 425 | * |
426 | - * @return iterable |
|
426 | + * @return Generator |
|
427 | 427 | * |
428 | 428 | * @SuppressWarnings(PHPMD.StaticAccess) |
429 | 429 | * @SuppressWarnings(PHPMD.ElseExpression) |
@@ -456,9 +456,9 @@ discard block |
||
456 | 456 | } |
457 | 457 | |
458 | 458 | /** |
459 | - * @param iterable $sortsFromParent |
|
459 | + * @param Generator $sortsFromParent |
|
460 | 460 | * |
461 | - * @return iterable |
|
461 | + * @return Generator |
|
462 | 462 | * |
463 | 463 | * @SuppressWarnings(PHPMD.StaticAccess) |
464 | 464 | * @SuppressWarnings(PHPMD.ElseExpression) |
@@ -488,9 +488,9 @@ discard block |
||
488 | 488 | } |
489 | 489 | |
490 | 490 | /** |
491 | - * @param iterable $includesFromParent |
|
491 | + * @param Generator $includesFromParent |
|
492 | 492 | * |
493 | - * @return iterable |
|
493 | + * @return Generator |
|
494 | 494 | * |
495 | 495 | * @SuppressWarnings(PHPMD.StaticAccess) |
496 | 496 | * @SuppressWarnings(PHPMD.ElseExpression) |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | } |
521 | 521 | |
522 | 522 | /** |
523 | - * @param iterable $iterable |
|
523 | + * @param Generator $iterable |
|
524 | 524 | * |
525 | 525 | * @return array |
526 | 526 | */ |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | * @param int $ruleIndex |
684 | 684 | * @param iterable $values |
685 | 685 | * |
686 | - * @return iterable |
|
686 | + * @return Generator |
|
687 | 687 | */ |
688 | 688 | private function validateValues(int $ruleIndex, iterable $values): iterable |
689 | 689 | { |
@@ -698,9 +698,9 @@ discard block |
||
698 | 698 | |
699 | 699 | /** |
700 | 700 | * @param int $ruleIndex |
701 | - * @param iterable $opsAndArgs |
|
701 | + * @param Generator $opsAndArgs |
|
702 | 702 | * |
703 | - * @return iterable |
|
703 | + * @return Generator |
|
704 | 704 | */ |
705 | 705 | private function validateFilterArguments(int $ruleIndex, iterable $opsAndArgs): iterable |
706 | 706 | { |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | * @param string $parameterName |
859 | 859 | * @param array $value |
860 | 860 | * |
861 | - * @return iterable |
|
861 | + * @return Generator |
|
862 | 862 | * |
863 | 863 | * @SuppressWarnings(PHPMD.ElseExpression) |
864 | 864 | */ |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | ) { |
156 | 156 | assert( |
157 | 157 | in_array(JsonApiQueryRulesSerializerInterface::class, class_implements($serializerClass)), |
158 | - "`$serializerClass` should implement interface `" . JsonApiQueryRulesSerializerInterface::class . '`.' |
|
158 | + "`$serializerClass` should implement interface `".JsonApiQueryRulesSerializerInterface::class.'`.' |
|
159 | 159 | ); |
160 | 160 | |
161 | 161 | $parameters = []; |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | { |
572 | 572 | // no validation rule means we should accept any input value |
573 | 573 | if ($ruleIndexes === null) { |
574 | - return is_numeric($value) === true ? (int)$value : 0; |
|
574 | + return is_numeric($value) === true ? (int) $value : 0; |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | $ruleIndex = $this->serializerClass::readRuleMainIndex($ruleIndexes); |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | |
583 | 583 | $validatedValue = $this->readSingleCapturedValue(); |
584 | 584 | |
585 | - return (int)$validatedValue; |
|
585 | + return (int) $validatedValue; |
|
586 | 586 | } |
587 | 587 | |
588 | 588 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | parse_str($this->getOriginalUri()->getQuery(), $queryParams); |
127 | 127 | |
128 | - return function ($offset) use ($pageSize, $queryParams) { |
|
128 | + return function($offset) use ($pageSize, $queryParams) { |
|
129 | 129 | $paramsWithPaging = array_merge($queryParams, [ |
130 | 130 | BaseQueryParserInterface::PARAM_PAGE => [ |
131 | 131 | JsonApiQueryValidatingParserInterface::PARAM_PAGING_OFFSET => $offset, |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ], |
134 | 134 | ]); |
135 | 135 | $newUri = $this->getOriginalUri()->withQuery(http_build_query($paramsWithPaging)); |
136 | - $fullUrl = (string)$newUri; |
|
136 | + $fullUrl = (string) $newUri; |
|
137 | 137 | $link = $this->getFactory()->createLink($fullUrl, null, true); |
138 | 138 | |
139 | 139 | return $link; |
@@ -212,12 +212,12 @@ |
||
212 | 212 | return [static::DATA => $data->getData()]; |
213 | 213 | } |
214 | 214 | |
215 | - $buildUrl = function ($offset) use ($data, $uri) { |
|
215 | + $buildUrl = function($offset) use ($data, $uri) { |
|
216 | 216 | $paramsWithPaging = [ |
217 | 217 | JsonApiQueryValidatingParserInterface::PARAM_PAGING_OFFSET => $offset, |
218 | 218 | JsonApiQueryValidatingParserInterface::PARAM_PAGING_LIMIT => $data->getLimit(), |
219 | 219 | ]; |
220 | - $fullUrl = $uri . '?' . http_build_query($paramsWithPaging); |
|
220 | + $fullUrl = $uri.'?'.http_build_query($paramsWithPaging); |
|
221 | 221 | |
222 | 222 | return $fullUrl; |
223 | 223 | }; |
@@ -269,7 +269,7 @@ |
||
269 | 269 | * @param FactoryInterface $errorFactory |
270 | 270 | * @param FormatterFactoryInterface $formatterFactory |
271 | 271 | * |
272 | - * @return ResponseInterface |
|
272 | + * @return string |
|
273 | 273 | */ |
274 | 274 | protected static function defaultCreate( |
275 | 275 | string $requestBody, |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | $modelClass = $schemaClass::MODEL; |
650 | 650 | assert($schemaInfo->hasRelationship($modelClass, $modelRelName)); |
651 | 651 | assert( |
652 | - ($type =$schemaInfo->getRelationshipType($modelClass, $modelRelName)) === RelationshipTypes::BELONGS_TO || |
|
652 | + ($type = $schemaInfo->getRelationshipType($modelClass, $modelRelName)) === RelationshipTypes::BELONGS_TO || |
|
653 | 653 | $type === RelationshipTypes::BELONGS_TO_MANY |
654 | 654 | ); |
655 | 655 | |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | */ |
905 | 905 | private static function assertClassValueDefined(?string $value): void |
906 | 906 | { |
907 | - assert(empty($value) === false, 'Value should be defined in `' . static::class . '`.'); |
|
907 | + assert(empty($value) === false, 'Value should be defined in `'.static::class.'`.'); |
|
908 | 908 | } |
909 | 909 | |
910 | 910 | /** |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | { |
918 | 918 | assert( |
919 | 919 | array_key_exists($interface, class_implements($class)) === true, |
920 | - "Class `$class` should implement `" . $interface . '` interface.' |
|
920 | + "Class `$class` should implement `".$interface.'` interface.' |
|
921 | 921 | ); |
922 | 922 | } |
923 | 923 | } |