@@ -47,22 +47,22 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | $factory = new Factory($container); |
| 49 | 49 | |
| 50 | - $container[FactoryInterface::class] = function () use ($factory) { |
|
| 50 | + $container[FactoryInterface::class] = function() use ($factory) { |
|
| 51 | 51 | return $factory; |
| 52 | 52 | }; |
| 53 | 53 | |
| 54 | - $container[QueryParametersParserInterface::class] = function () use ($factory) { |
|
| 54 | + $container[QueryParametersParserInterface::class] = function() use ($factory) { |
|
| 55 | 55 | return $factory->getJsonApiFactory()->createQueryParametersParser(); |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | - $container[JsonSchemesInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 58 | + $container[JsonSchemesInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 59 | 59 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
| 60 | 60 | $modelSchemes = $container->get(ModelSchemeInfoInterface::class); |
| 61 | 61 | |
| 62 | 62 | return $factory->createJsonSchemes($settings[FluteSettings::KEY_MODEL_TO_SCHEME_MAP], $modelSchemes); |
| 63 | 63 | }; |
| 64 | 64 | |
| 65 | - $container[EncoderInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 65 | + $container[EncoderInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 66 | 66 | /** @var JsonSchemesInterface $jsonSchemes */ |
| 67 | 67 | $jsonSchemes = $container->get(JsonSchemesInterface::class); |
| 68 | 68 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | return $encoder; |
| 78 | 78 | }; |
| 79 | 79 | |
| 80 | - $container[FilterOperationsInterface::class] = function (PsrContainerInterface $container) { |
|
| 80 | + $container[FilterOperationsInterface::class] = function(PsrContainerInterface $container) { |
|
| 81 | 81 | return new FilterOperations($container); |
| 82 | 82 | }; |
| 83 | 83 | |
| 84 | - $container[RepositoryInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 84 | + $container[RepositoryInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 85 | 85 | $connection = $container->get(Connection::class); |
| 86 | 86 | /** @var ModelSchemeInfoInterface $modelSchemes */ |
| 87 | 87 | $modelSchemes = $container->get(ModelSchemeInfoInterface::class); |
@@ -96,13 +96,13 @@ discard block |
||
| 96 | 96 | return $factory->createRepository($connection, $modelSchemes, $filerOps, $formatter); |
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | - $container[PaginationStrategyInterface::class] = function (PsrContainerInterface $container) { |
|
| 99 | + $container[PaginationStrategyInterface::class] = function(PsrContainerInterface $container) { |
|
| 100 | 100 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
| 101 | 101 | |
| 102 | 102 | return new PaginationStrategy($settings[FluteSettings::KEY_RELATIONSHIP_PAGING_SIZE]); |
| 103 | 103 | }; |
| 104 | 104 | |
| 105 | - $container[JsonApiValidatorFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
| 105 | + $container[JsonApiValidatorFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
| 106 | 106 | $factory = new JsonApiValidatorFactory($container); |
| 107 | 107 | |
| 108 | 108 | return $factory; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public static function configureExceptionHandler(LimoncelloContainerInterface $container) |
| 129 | 129 | { |
| 130 | - $container[ExceptionHandlerInterface::class] = function () { |
|
| 130 | + $container[ExceptionHandlerInterface::class] = function() { |
|
| 131 | 131 | return new FluteExceptionHandler(); |
| 132 | 132 | }; |
| 133 | 133 | } |
@@ -77,8 +77,7 @@ |
||
| 77 | 77 | assert(is_scalar($index) === true && is_scalar($type) === true); |
| 78 | 78 | $expectedType = $context->getProperties()->getProperty(self::PROPERTY_RESOURCE_TYPE); |
| 79 | 79 | $reply = $type === $expectedType ? |
| 80 | - BlockReplies::createSuccessReply($index) : |
|
| 81 | - BlockReplies::createErrorReply($context, $type, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
| 80 | + BlockReplies::createSuccessReply($index) : BlockReplies::createErrorReply($context, $type, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
| 82 | 81 | |
| 83 | 82 | return $reply; |
| 84 | 83 | } |
@@ -105,8 +105,7 @@ |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | $reply = $count > 0 ? |
| 108 | - BlockReplies::createSuccessReply($values) : |
|
| 109 | - BlockReplies::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
| 108 | + BlockReplies::createSuccessReply($values) : BlockReplies::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
| 110 | 109 | |
| 111 | 110 | return $reply; |
| 112 | 111 | } |
@@ -101,8 +101,7 @@ |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $reply = $count <= 0 ? |
| 104 | - BlockReplies::createSuccessReply($value) : |
|
| 105 | - BlockReplies::createErrorReply($context, $value, ErrorCodes::UNIQUE_IN_DATABASE_SINGLE); |
|
| 104 | + BlockReplies::createSuccessReply($value) : BlockReplies::createErrorReply($context, $value, ErrorCodes::UNIQUE_IN_DATABASE_SINGLE); |
|
| 106 | 105 | |
| 107 | 106 | return $reply; |
| 108 | 107 | } |
@@ -86,8 +86,7 @@ |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $reply = $foundInvalidType === null ? |
| 89 | - BlockReplies::createSuccessReply($indexes) : |
|
| 90 | - BlockReplies::createErrorReply($context, $foundInvalidType, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
| 89 | + BlockReplies::createSuccessReply($indexes) : BlockReplies::createErrorReply($context, $foundInvalidType, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
| 91 | 90 | |
| 92 | 91 | return $reply; |
| 93 | 92 | } |
@@ -101,8 +101,7 @@ |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $reply = $count > 0 ? |
| 104 | - BlockReplies::createSuccessReply($value) : |
|
| 105 | - BlockReplies::createErrorReply($context, $value, ErrorCodes::EXIST_IN_DATABASE_SINGLE); |
|
| 104 | + BlockReplies::createSuccessReply($value) : BlockReplies::createErrorReply($context, $value, ErrorCodes::EXIST_IN_DATABASE_SINGLE); |
|
| 106 | 105 | |
| 107 | 106 | return $reply; |
| 108 | 107 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $queryParser = $container->get(QueryParametersParserInterface::class); |
| 130 | 130 | $encodingParams = $queryParser->parse($request); |
| 131 | 131 | |
| 132 | - list ($filters, , $includes) = static::mapQueryParameters($container, $encodingParams, static::SCHEMA_CLASS); |
|
| 132 | + list ($filters,, $includes) = static::mapQueryParameters($container, $encodingParams, static::SCHEMA_CLASS); |
|
| 133 | 133 | |
| 134 | 134 | $index = $routeParams[static::ROUTE_KEY_INDEX]; |
| 135 | 135 | $response = static::readImpl( |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | /** @var JsonSchemesInterface $jsonSchemes */ |
| 485 | 485 | $jsonSchemes = $container->get(JsonSchemesInterface::class); |
| 486 | 486 | $targetSchema = $jsonSchemes->getRelationshipSchema(static::SCHEMA_CLASS, $relationshipName); |
| 487 | - list ($filters, $sorts, , $paging) = |
|
| 487 | + list ($filters, $sorts,, $paging) = |
|
| 488 | 488 | static::mapQueryParameters($container, $encodingParams, get_class($targetSchema)); |
| 489 | 489 | |
| 490 | 490 | /** @var SchemaInterface $schemaClass */ |