@@ -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 | |
@@ -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 |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | if ($this->hasFilters() === true) { |
| 1036 | 1036 | $filters = $this->getFilters(); |
| 1037 | 1037 | $sorts = $this->getSorts(); |
| 1038 | - $joinCondition = $this->areFiltersWithAnd() === true ? ModelQueryBuilder::AND : ModelQueryBuilder::OR; |
|
| 1038 | + $joinCondition = $this->areFiltersWithAnd() === true ? ModelQueryBuilder:: AND : ModelQueryBuilder:: OR ; |
|
| 1039 | 1039 | $builder->addRelationshipFiltersAndSorts($reverseRelName, $filters, $sorts, $joinCondition); |
| 1040 | 1040 | } |
| 1041 | 1041 | // ... and the input filters to actual data we select |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | ) { |
| 1067 | 1067 | assert( |
| 1068 | 1068 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $name), |
| 1069 | - "Relationship `$name` do not exist in model `" . $this->getModelClass() . '`' |
|
| 1069 | + "Relationship `$name` do not exist in model `".$this->getModelClass().'`' |
|
| 1070 | 1070 | ); |
| 1071 | 1071 | |
| 1072 | 1072 | // depending on the relationship type we expect the result to be either single resource or a collection |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | ): array { |
| 1096 | 1096 | assert( |
| 1097 | 1097 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $name), |
| 1098 | - "Relationship `$name` do not exist in model `" . $this->getModelClass() . '`' |
|
| 1098 | + "Relationship `$name` do not exist in model `".$this->getModelClass().'`' |
|
| 1099 | 1099 | ); |
| 1100 | 1100 | |
| 1101 | 1101 | // depending on the relationship type we expect the result to be either single resource or a collection |
@@ -1171,7 +1171,7 @@ discard block |
||
| 1171 | 1171 | |
| 1172 | 1172 | $this->clearFetchParameters(); |
| 1173 | 1173 | |
| 1174 | - return (int)$deleted; |
|
| 1174 | + return (int) $deleted; |
|
| 1175 | 1175 | } |
| 1176 | 1176 | |
| 1177 | 1177 | /** |
@@ -1187,7 +1187,7 @@ discard block |
||
| 1187 | 1187 | |
| 1188 | 1188 | $this->clearFetchParameters(); |
| 1189 | 1189 | |
| 1190 | - return (int)$deleted > 0; |
|
| 1190 | + return (int) $deleted > 0; |
|
| 1191 | 1191 | } |
| 1192 | 1192 | |
| 1193 | 1193 | /** |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | |
| 1213 | 1213 | $this->clearBuilderParameters()->clearFetchParameters(); |
| 1214 | 1214 | |
| 1215 | - $this->inTransaction(function () use ($saveMain, $toMany, &$index) { |
|
| 1215 | + $this->inTransaction(function() use ($saveMain, $toMany, &$index) { |
|
| 1216 | 1216 | $saveMain->execute(); |
| 1217 | 1217 | |
| 1218 | 1218 | // if no index given will use last insert ID as index |
@@ -1253,12 +1253,12 @@ discard block |
||
| 1253 | 1253 | ->createBuilder($this->getModelClass()) |
| 1254 | 1254 | ->updateModels($allowedChanges) |
| 1255 | 1255 | ->addFiltersWithAndToTable($filters); |
| 1256 | - $saveMain = $this->builderSaveResourceOnUpdate($saveMain); |
|
| 1256 | + $saveMain = $this->builderSaveResourceOnUpdate($saveMain); |
|
| 1257 | 1257 | $saveMain->getSQL(); // prepare |
| 1258 | 1258 | |
| 1259 | 1259 | $this->clearBuilderParameters()->clearFetchParameters(); |
| 1260 | 1260 | |
| 1261 | - $this->inTransaction(function () use ($saveMain, $toMany, $index, &$updated) { |
|
| 1261 | + $this->inTransaction(function() use ($saveMain, $toMany, $index, &$updated) { |
|
| 1262 | 1262 | $updated = $saveMain->execute(); |
| 1263 | 1263 | |
| 1264 | 1264 | $builderHook = Closure::fromCallable([$this, 'builderSaveRelationshipOnUpdate']); |
@@ -1274,7 +1274,7 @@ discard block |
||
| 1274 | 1274 | )->execute(); |
| 1275 | 1275 | |
| 1276 | 1276 | // add new ones |
| 1277 | - $updated += $this->addInToManyRelationship( |
|
| 1277 | + $updated += $this->addInToManyRelationship( |
|
| 1278 | 1278 | $connection, |
| 1279 | 1279 | $index, |
| 1280 | 1280 | $relationshipName, |
@@ -1284,7 +1284,7 @@ discard block |
||
| 1284 | 1284 | } |
| 1285 | 1285 | }); |
| 1286 | 1286 | |
| 1287 | - return (int)$updated; |
|
| 1287 | + return (int) $updated; |
|
| 1288 | 1288 | } |
| 1289 | 1289 | |
| 1290 | 1290 | /** |
@@ -1299,9 +1299,9 @@ discard block |
||
| 1299 | 1299 | public function createInBelongsToManyRelationship(string $parentId, string $name, iterable $childIds): int |
| 1300 | 1300 | { |
| 1301 | 1301 | // Check that relationship is `BelongsToMany` |
| 1302 | - assert(call_user_func(function () use ($name): bool { |
|
| 1302 | + assert(call_user_func(function() use ($name): bool { |
|
| 1303 | 1303 | $relType = $this->getModelSchemas()->getRelationshipType($this->getModelClass(), $name); |
| 1304 | - $errMsg = "Relationship `$name` of class `" . $this->getModelClass() . |
|
| 1304 | + $errMsg = "Relationship `$name` of class `".$this->getModelClass(). |
|
| 1305 | 1305 | '` either is not `belongsToMany` or do not exist in the class.'; |
| 1306 | 1306 | $isOk = $relType === RelationshipTypes::BELONGS_TO_MANY; |
| 1307 | 1307 | |
@@ -1323,9 +1323,9 @@ discard block |
||
| 1323 | 1323 | public function removeInBelongsToManyRelationship(string $parentId, string $name, iterable $childIds): int |
| 1324 | 1324 | { |
| 1325 | 1325 | // Check that relationship is `BelongsToMany` |
| 1326 | - assert(call_user_func(function () use ($name): bool { |
|
| 1326 | + assert(call_user_func(function() use ($name): bool { |
|
| 1327 | 1327 | $relType = $this->getModelSchemas()->getRelationshipType($this->getModelClass(), $name); |
| 1328 | - $errMsg = "Relationship `$name` of class `" . $this->getModelClass() . |
|
| 1328 | + $errMsg = "Relationship `$name` of class `".$this->getModelClass(). |
|
| 1329 | 1329 | '` either is not `belongsToMany` or do not exist in the class.'; |
| 1330 | 1330 | $isOk = $relType === RelationshipTypes::BELONGS_TO_MANY; |
| 1331 | 1331 | |
@@ -1493,7 +1493,7 @@ discard block |
||
| 1493 | 1493 | { |
| 1494 | 1494 | $countBuilder = $this->createBuilder($this->getModelClass()); |
| 1495 | 1495 | $countBuilder->setParameters($builder->getParameters()); |
| 1496 | - $countBuilder->select('COUNT(*)')->from('(' . $builder->getSQL() . ') AS RESULT'); |
|
| 1496 | + $countBuilder->select('COUNT(*)')->from('('.$builder->getSQL().') AS RESULT'); |
|
| 1497 | 1497 | |
| 1498 | 1498 | return $countBuilder; |
| 1499 | 1499 | } |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | |
| 1526 | 1526 | foreach ($secondaryIdentities as $secondaryId) { |
| 1527 | 1527 | try { |
| 1528 | - $inserted += (int)$saveToMany->setParameter($secondaryIdBindName, $secondaryId)->execute(); |
|
| 1528 | + $inserted += (int) $saveToMany->setParameter($secondaryIdBindName, $secondaryId)->execute(); |
|
| 1529 | 1529 | } /** @noinspection PhpRedundantCatchClauseInspection */ catch (UcvException $exception) { |
| 1530 | 1530 | // Spec: If all of the specified resources can be added to, or are already present in, |
| 1531 | 1531 | // the relationship then the server MUST return a successful response. |
@@ -1772,7 +1772,7 @@ discard block |
||
| 1772 | 1772 | |
| 1773 | 1773 | $pkName = $this->getModelSchemas()->getPrimaryKey($parentClass); |
| 1774 | 1774 | |
| 1775 | - $registerModelAtPath = function ($model, string $path) use ($deDup, $modelsAtPath, $idsAtPath) { |
|
| 1775 | + $registerModelAtPath = function($model, string $path) use ($deDup, $modelsAtPath, $idsAtPath) { |
|
| 1776 | 1776 | return self::registerModelAtPath( |
| 1777 | 1777 | $model, |
| 1778 | 1778 | $path, |
@@ -1784,7 +1784,7 @@ discard block |
||
| 1784 | 1784 | }; |
| 1785 | 1785 | |
| 1786 | 1786 | foreach ($childRelationships as $name) { |
| 1787 | - $childrenPath = $parentsPath !== static::ROOT_PATH ? $parentsPath . static::PATH_SEPARATOR . $name : $name; |
|
| 1787 | + $childrenPath = $parentsPath !== static::ROOT_PATH ? $parentsPath.static::PATH_SEPARATOR.$name : $name; |
|
| 1788 | 1788 | |
| 1789 | 1789 | $relationshipType = $this->getModelSchemas()->getRelationshipType($parentClass, $name); |
| 1790 | 1790 | list ($targetModelClass, $reverseRelName) = |
@@ -1839,7 +1839,7 @@ discard block |
||
| 1839 | 1839 | [$pkName => [FilterParameterInterface::OPERATION_EQUALS => [$parent->{$pkName}]]], |
| 1840 | 1840 | [] |
| 1841 | 1841 | ); |
| 1842 | - $children = $this->fetchPaginatedResourcesWithoutRelationships( |
|
| 1842 | + $children = $this->fetchPaginatedResourcesWithoutRelationships( |
|
| 1843 | 1843 | $clonedBuilder, |
| 1844 | 1844 | $clonedBuilder->getModelClass() |
| 1845 | 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 | /** |
@@ -48,18 +48,18 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $container[FactoryInterface::class] = $factory; |
| 50 | 50 | |
| 51 | - $container[JsonSchemasInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 51 | + $container[JsonSchemasInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 52 | 52 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
| 53 | 53 | $modelSchemas = $container->get(ModelSchemaInfoInterface::class); |
| 54 | 54 | |
| 55 | 55 | return $factory->createJsonSchemas($settings[FluteSettings::KEY_MODEL_TO_SCHEMA_MAP], $modelSchemas); |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | - $container[ParametersMapperInterface::class] = function (PsrContainerInterface $container) { |
|
| 58 | + $container[ParametersMapperInterface::class] = function(PsrContainerInterface $container) { |
|
| 59 | 59 | return new ParametersMapper($container->get(JsonSchemasInterface::class)); |
| 60 | 60 | }; |
| 61 | 61 | |
| 62 | - $container[EncoderInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 62 | + $container[EncoderInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 63 | 63 | /** @var JsonSchemasInterface $jsonSchemas */ |
| 64 | 64 | $jsonSchemas = $container->get(JsonSchemasInterface::class); |
| 65 | 65 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
@@ -74,19 +74,19 @@ discard block |
||
| 74 | 74 | return $encoder; |
| 75 | 75 | }; |
| 76 | 76 | |
| 77 | - $container[RelationshipPaginationStrategyInterface::class] = function (PsrContainerInterface $container) { |
|
| 77 | + $container[RelationshipPaginationStrategyInterface::class] = function(PsrContainerInterface $container) { |
|
| 78 | 78 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
| 79 | 79 | |
| 80 | 80 | return new BasicRelationshipPaginationStrategy($settings[FluteSettings::KEY_DEFAULT_PAGING_SIZE]); |
| 81 | 81 | }; |
| 82 | 82 | |
| 83 | - $container[JsonApiParserFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
| 83 | + $container[JsonApiParserFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
| 84 | 84 | $factory = new JsonApiParserFactory($container); |
| 85 | 85 | |
| 86 | 86 | return $factory; |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | - $container[FormValidatorFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
| 89 | + $container[FormValidatorFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
| 90 | 90 | $factory = new FormValidatorFactory($container); |
| 91 | 91 | |
| 92 | 92 | return $factory; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public static function configureExceptionHandler(LimoncelloContainerInterface $container) |
| 106 | 106 | { |
| 107 | - $container[ThrowableHandlerInterface::class] = function (PsrContainerInterface $container) { |
|
| 107 | + $container[ThrowableHandlerInterface::class] = function(PsrContainerInterface $container) { |
|
| 108 | 108 | /** @var CacheSettingsProviderInterface $provider */ |
| 109 | 109 | $provider = $container->get(CacheSettingsProviderInterface::class); |
| 110 | 110 | $appConfig = $provider->getApplicationConfiguration(); |
@@ -111,10 +111,10 @@ |
||
| 111 | 111 | ); |
| 112 | 112 | assert(empty($jsonQueryValFileMask) === false, "Invalid Query Validators file mask `$jsonQueryValFileMask`."); |
| 113 | 113 | |
| 114 | - $schemasPath = $schemasFolder . DIRECTORY_SEPARATOR . $schemasFileMask; |
|
| 115 | - $jsonDataValPath = $jsonDataValFolder . DIRECTORY_SEPARATOR . $jsonDataValFileMask; |
|
| 116 | - $formsValidatorsPath = $formsValFolder . DIRECTORY_SEPARATOR . $formsValFileMask; |
|
| 117 | - $jsonQueryValPath = $jsonQueryValFolder . DIRECTORY_SEPARATOR . $jsonQueryValFileMask; |
|
| 114 | + $schemasPath = $schemasFolder.DIRECTORY_SEPARATOR.$schemasFileMask; |
|
| 115 | + $jsonDataValPath = $jsonDataValFolder.DIRECTORY_SEPARATOR.$jsonDataValFileMask; |
|
| 116 | + $formsValidatorsPath = $formsValFolder.DIRECTORY_SEPARATOR.$formsValFileMask; |
|
| 117 | + $jsonQueryValPath = $jsonQueryValFolder.DIRECTORY_SEPARATOR.$jsonQueryValFileMask; |
|
| 118 | 118 | |
| 119 | 119 | $requireUniqueTypes = $defaults[static::KEY_SCHEMAS_REQUIRE_UNIQUE_TYPES] ?? true; |
| 120 | 120 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | static::assertClassValueDefined(static::SCHEMA_CLASS); |
| 209 | 209 | |
| 210 | 210 | $api = static::defaultCreateApi($container, static::API_CLASS); |
| 211 | - $handler = function () use ($api, $index, $modelRelName) { |
|
| 211 | + $handler = function() use ($api, $index, $modelRelName) { |
|
| 212 | 212 | return $api->readRelationship($index, $modelRelName); |
| 213 | 213 | }; |
| 214 | 214 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | static::assertClassValueDefined(static::SCHEMA_CLASS); |
| 249 | 249 | |
| 250 | 250 | $api = static::defaultCreateApi($container, static::API_CLASS); |
| 251 | - $handler = function () use ($api, $index, $modelRelName) { |
|
| 251 | + $handler = function() use ($api, $index, $modelRelName) { |
|
| 252 | 252 | return $api->readRelationship($index, $modelRelName); |
| 253 | 253 | }; |
| 254 | 254 | |
@@ -71,8 +71,7 @@ |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $reply = $foundInvalidType === null ? |
| 74 | - static::createSuccessReply($indexes) : |
|
| 75 | - static::createErrorReply($context, $foundInvalidType, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
| 74 | + static::createSuccessReply($indexes) : static::createErrorReply($context, $foundInvalidType, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
| 76 | 75 | |
| 77 | 76 | return $reply; |
| 78 | 77 | } |