@@ -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 | } |
@@ -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 | /** |
@@ -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 | } |
@@ -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 | } |
@@ -77,7 +77,6 @@ |
||
| 77 | 77 | $result = count($readIndexes) === count($values); |
| 78 | 78 | |
| 79 | 79 | return $result === true ? |
| 80 | - static::createSuccessReply($values) : |
|
| 81 | - static::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
| 80 | + static::createSuccessReply($values) : static::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
| 82 | 81 | } |
| 83 | 82 | } |
@@ -76,7 +76,6 @@ |
||
| 76 | 76 | $result = !empty($data); |
| 77 | 77 | |
| 78 | 78 | return $result === true ? |
| 79 | - static::createSuccessReply($value) : |
|
| 80 | - static::createErrorReply($context, $value, ErrorCodes::EXIST_IN_DATABASE_SINGLE); |
|
| 79 | + static::createSuccessReply($value) : static::createErrorReply($context, $value, ErrorCodes::EXIST_IN_DATABASE_SINGLE); |
|
| 81 | 80 | } |
| 82 | 81 | } |