@@ -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 | */ |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | throw new InvalidArgumentException($this->getMessage(Messages::MSG_ERR_INVALID_ARGUMENT)); |
213 | 213 | } |
214 | 214 | |
215 | - assert(call_user_func(function () use ($indexes) { |
|
215 | + assert(call_user_func(function() use ($indexes) { |
|
216 | 216 | $allOk = true; |
217 | 217 | |
218 | 218 | foreach ($indexes as $index) { |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | $classAtPath = new ArrayObject(); |
765 | 765 | $idsAtPath = new ArrayObject(); |
766 | 766 | |
767 | - $registerModelAtRoot = function ($model) use ($modelStorage, $modelsAtPath, $idsAtPath): void { |
|
767 | + $registerModelAtRoot = function($model) use ($modelStorage, $modelsAtPath, $idsAtPath): void { |
|
768 | 768 | self::registerModelAtPath( |
769 | 769 | $model, |
770 | 770 | static::ROOT_PATH, |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | assert(is_string($pathPiece)); |
853 | 853 | $parent = $tmpPath; |
854 | 854 | $tmpPath = empty($tmpPath) === true ? |
855 | - $pathPiece : $tmpPath . static::PATH_SEPARATOR . $pathPiece; |
|
855 | + $pathPiece : $tmpPath.static::PATH_SEPARATOR.$pathPiece; |
|
856 | 856 | $normalizedPaths[$tmpPath] = [$parent, $pathPiece]; |
857 | 857 | $pathsDepths[$parent] = $parentDepth++; |
858 | 858 | } |
@@ -1021,7 +1021,7 @@ discard block |
||
1021 | 1021 | ): ModelQueryBuilder { |
1022 | 1022 | assert( |
1023 | 1023 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $relationshipName), |
1024 | - "Relationship `$relationshipName` do not exist in model `" . $this->getModelClass() . '`' |
|
1024 | + "Relationship `$relationshipName` do not exist in model `".$this->getModelClass().'`' |
|
1025 | 1025 | ); |
1026 | 1026 | |
1027 | 1027 | // as we read data from a relationship our main table and model would be the table/model in the relationship |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | if ($this->hasFilters() === true) { |
1040 | 1040 | $filters = $this->getFilters(); |
1041 | 1041 | $sorts = $this->getSorts(); |
1042 | - $joinCondition = $this->areFiltersWithAnd() === true ? ModelQueryBuilder::AND : ModelQueryBuilder::OR; |
|
1042 | + $joinCondition = $this->areFiltersWithAnd() === true ? ModelQueryBuilder:: AND : ModelQueryBuilder:: OR ; |
|
1043 | 1043 | $builder->addRelationshipFiltersAndSorts($reverseRelName, $filters, $sorts, $joinCondition); |
1044 | 1044 | } |
1045 | 1045 | // ... and the input filters to actual data we select |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | ) { |
1071 | 1071 | assert( |
1072 | 1072 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $name), |
1073 | - "Relationship `$name` do not exist in model `" . $this->getModelClass() . '`' |
|
1073 | + "Relationship `$name` do not exist in model `".$this->getModelClass().'`' |
|
1074 | 1074 | ); |
1075 | 1075 | |
1076 | 1076 | // depending on the relationship type we expect the result to be either single resource or a collection |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | ): array { |
1100 | 1100 | assert( |
1101 | 1101 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $name), |
1102 | - "Relationship `$name` do not exist in model `" . $this->getModelClass() . '`' |
|
1102 | + "Relationship `$name` do not exist in model `".$this->getModelClass().'`' |
|
1103 | 1103 | ); |
1104 | 1104 | |
1105 | 1105 | // depending on the relationship type we expect the result to be either single resource or a collection |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | |
1176 | 1176 | $this->clearFetchParameters(); |
1177 | 1177 | |
1178 | - return (int)$deleted; |
|
1178 | + return (int) $deleted; |
|
1179 | 1179 | } |
1180 | 1180 | |
1181 | 1181 | /** |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | |
1192 | 1192 | $this->clearFetchParameters(); |
1193 | 1193 | |
1194 | - return (int)$deleted > 0; |
|
1194 | + return (int) $deleted > 0; |
|
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | /** |
@@ -1216,7 +1216,7 @@ discard block |
||
1216 | 1216 | |
1217 | 1217 | $this->clearBuilderParameters()->clearFetchParameters(); |
1218 | 1218 | |
1219 | - $this->inTransaction(function () use ($saveMain, $toMany, &$index) { |
|
1219 | + $this->inTransaction(function() use ($saveMain, $toMany, &$index) { |
|
1220 | 1220 | $saveMain->execute(); |
1221 | 1221 | |
1222 | 1222 | // if no index given will use last insert ID as index |
@@ -1257,12 +1257,12 @@ discard block |
||
1257 | 1257 | ->createBuilder($this->getModelClass()) |
1258 | 1258 | ->updateModels($allowedChanges) |
1259 | 1259 | ->addFiltersWithAndToTable($filters); |
1260 | - $saveMain = $this->builderSaveResourceOnUpdate($saveMain); |
|
1260 | + $saveMain = $this->builderSaveResourceOnUpdate($saveMain); |
|
1261 | 1261 | $saveMain->getSQL(); // prepare |
1262 | 1262 | |
1263 | 1263 | $this->clearBuilderParameters()->clearFetchParameters(); |
1264 | 1264 | |
1265 | - $this->inTransaction(function () use ($saveMain, $toMany, $index, &$updated) { |
|
1265 | + $this->inTransaction(function() use ($saveMain, $toMany, $index, &$updated) { |
|
1266 | 1266 | $updated = $saveMain->execute(); |
1267 | 1267 | |
1268 | 1268 | $builderHook = Closure::fromCallable([$this, 'builderSaveRelationshipOnUpdate']); |
@@ -1278,7 +1278,7 @@ discard block |
||
1278 | 1278 | )->execute(); |
1279 | 1279 | |
1280 | 1280 | // add new ones |
1281 | - $updated += $this->addInToManyRelationship( |
|
1281 | + $updated += $this->addInToManyRelationship( |
|
1282 | 1282 | $connection, |
1283 | 1283 | $index, |
1284 | 1284 | $relationshipName, |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | } |
1289 | 1289 | }); |
1290 | 1290 | |
1291 | - return (int)$updated; |
|
1291 | + return (int) $updated; |
|
1292 | 1292 | } |
1293 | 1293 | |
1294 | 1294 | /** |
@@ -1303,9 +1303,9 @@ discard block |
||
1303 | 1303 | public function createInBelongsToManyRelationship(string $parentId, string $name, iterable $childIds): int |
1304 | 1304 | { |
1305 | 1305 | // Check that relationship is `BelongsToMany` |
1306 | - assert(call_user_func(function () use ($name): bool { |
|
1306 | + assert(call_user_func(function() use ($name): bool { |
|
1307 | 1307 | $relType = $this->getModelSchemas()->getRelationshipType($this->getModelClass(), $name); |
1308 | - $errMsg = "Relationship `$name` of class `" . $this->getModelClass() . |
|
1308 | + $errMsg = "Relationship `$name` of class `".$this->getModelClass(). |
|
1309 | 1309 | '` either is not `belongsToMany` or do not exist in the class.'; |
1310 | 1310 | $isOk = $relType === RelationshipTypes::BELONGS_TO_MANY; |
1311 | 1311 | |
@@ -1327,9 +1327,9 @@ discard block |
||
1327 | 1327 | public function removeInBelongsToManyRelationship(string $parentId, string $name, iterable $childIds): int |
1328 | 1328 | { |
1329 | 1329 | // Check that relationship is `BelongsToMany` |
1330 | - assert(call_user_func(function () use ($name): bool { |
|
1330 | + assert(call_user_func(function() use ($name): bool { |
|
1331 | 1331 | $relType = $this->getModelSchemas()->getRelationshipType($this->getModelClass(), $name); |
1332 | - $errMsg = "Relationship `$name` of class `" . $this->getModelClass() . |
|
1332 | + $errMsg = "Relationship `$name` of class `".$this->getModelClass(). |
|
1333 | 1333 | '` either is not `belongsToMany` or do not exist in the class.'; |
1334 | 1334 | $isOk = $relType === RelationshipTypes::BELONGS_TO_MANY; |
1335 | 1335 | |
@@ -1497,7 +1497,7 @@ discard block |
||
1497 | 1497 | { |
1498 | 1498 | $countBuilder = $this->createBuilder($this->getModelClass()); |
1499 | 1499 | $countBuilder->setParameters($builder->getParameters()); |
1500 | - $countBuilder->select('COUNT(*)')->from('(' . $builder->getSQL() . ') AS RESULT'); |
|
1500 | + $countBuilder->select('COUNT(*)')->from('('.$builder->getSQL().') AS RESULT'); |
|
1501 | 1501 | |
1502 | 1502 | return $countBuilder; |
1503 | 1503 | } |
@@ -1529,7 +1529,7 @@ discard block |
||
1529 | 1529 | |
1530 | 1530 | foreach ($secondaryIdentities as $secondaryId) { |
1531 | 1531 | try { |
1532 | - $inserted += (int)$saveToMany->setParameter($secondaryIdBindName, $secondaryId)->execute(); |
|
1532 | + $inserted += (int) $saveToMany->setParameter($secondaryIdBindName, $secondaryId)->execute(); |
|
1533 | 1533 | } /** @noinspection PhpRedundantCatchClauseInspection */ catch (UcvException $exception) { |
1534 | 1534 | // Spec: If all of the specified resources can be added to, or are already present in, |
1535 | 1535 | // the relationship then the server MUST return a successful response. |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | |
1777 | 1777 | $pkName = $this->getModelSchemas()->getPrimaryKey($parentClass); |
1778 | 1778 | |
1779 | - $registerModelAtPath = function ($model, string $path) use ($deDup, $modelsAtPath, $idsAtPath) { |
|
1779 | + $registerModelAtPath = function($model, string $path) use ($deDup, $modelsAtPath, $idsAtPath) { |
|
1780 | 1780 | return self::registerModelAtPath( |
1781 | 1781 | $model, |
1782 | 1782 | $path, |
@@ -1788,7 +1788,7 @@ discard block |
||
1788 | 1788 | }; |
1789 | 1789 | |
1790 | 1790 | foreach ($childRelationships as $name) { |
1791 | - $childrenPath = $parentsPath !== static::ROOT_PATH ? $parentsPath . static::PATH_SEPARATOR . $name : $name; |
|
1791 | + $childrenPath = $parentsPath !== static::ROOT_PATH ? $parentsPath.static::PATH_SEPARATOR.$name : $name; |
|
1792 | 1792 | |
1793 | 1793 | $relationshipType = $this->getModelSchemas()->getRelationshipType($parentClass, $name); |
1794 | 1794 | list ($targetModelClass, $reverseRelName) = |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | [$pkName => [FilterParameterInterface::OPERATION_EQUALS => [$parent->{$pkName}]]], |
1844 | 1844 | [] |
1845 | 1845 | ); |
1846 | - $children = $this->fetchPaginatedResourcesWithoutRelationships( |
|
1846 | + $children = $this->fetchPaginatedResourcesWithoutRelationships( |
|
1847 | 1847 | $clonedBuilder, |
1848 | 1848 | $clonedBuilder->getModelClass() |
1849 | 1849 | ); |
@@ -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 | } |