@@ -24,12 +24,12 @@ discard block |
||
| 24 | 24 | /** |
| 25 | 25 | * @return string|null |
| 26 | 26 | */ |
| 27 | - public function getRelationshipName(): ?string; |
|
| 27 | + public function getRelationshipName(): ? string; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * @return string|null |
| 31 | 31 | */ |
| 32 | - public function getAttributeName(): ?string; |
|
| 32 | + public function getAttributeName(): ? string; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * @return string |
@@ -59,5 +59,5 @@ discard block |
||
| 59 | 59 | /** |
| 60 | 60 | * @return int|null |
| 61 | 61 | */ |
| 62 | - public function getRelationshipType(): ?int; |
|
| 62 | + public function getRelationshipType(): ? int; |
|
| 63 | 63 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | /** |
| 60 | 60 | * @return int|null |
| 61 | 61 | */ |
| 62 | - public function getOffset(): ?int; |
|
| 62 | + public function getOffset(): ? int; |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * @param int|null $offset |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * @return int|null |
| 73 | 73 | */ |
| 74 | - public function getLimit(): ?int; |
|
| 74 | + public function getLimit(): ? int; |
|
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | 77 | * @param int|null $size |
@@ -80,5 +80,5 @@ |
||
| 80 | 80 | * |
| 81 | 81 | * @return PaginatedDataInterface|null |
| 82 | 82 | */ |
| 83 | - public function getRelationship($model, string $relationship): ?PaginatedDataInterface; |
|
| 83 | + public function getRelationship($model, string $relationship): ? PaginatedDataInterface; |
|
| 84 | 84 | } |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | /** |
| 60 | 60 | * @inheritdoc |
| 61 | 61 | */ |
| 62 | - public function parseParameters(?array $parameters): array |
|
| 62 | + public function parseParameters(? array $parameters) : array |
|
| 63 | 63 | { |
| 64 | 64 | if ($parameters === null) { |
| 65 | 65 | return [0, $this->defaultPageLimit + 1]; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $pkColumn = $this->buildColumnName($table, $pkName); |
| 222 | 222 | $type = Type::getType($types[$pkName]); |
| 223 | 223 | $pdoValue = $type->convertToDatabaseValue($index, $dbPlatform); |
| 224 | - $builder->where($pkColumn . '=' . $builder->createNamedParameter($pdoValue, $type->getBindingType())); |
|
| 224 | + $builder->where($pkColumn.'='.$builder->createNamedParameter($pdoValue, $type->getBindingType())); |
|
| 225 | 225 | |
| 226 | 226 | return $builder; |
| 227 | 227 | } |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | foreach ($filterValue as $operation => $params) { |
| 352 | 352 | $filterTable = null; |
| 353 | 353 | $filterColumn = null; |
| 354 | - $lcOp = strtolower((string)$operation); |
|
| 354 | + $lcOp = strtolower((string) $operation); |
|
| 355 | 355 | |
| 356 | 356 | if ($filterParam->isForRelationship() === true) { |
| 357 | 357 | switch ($filterParam->getRelationshipType()) { |
@@ -366,8 +366,8 @@ discard block |
||
| 366 | 366 | $reversePk = $modelSchemes->getPrimaryKey($reverseClass); |
| 367 | 367 | $filterTable = $modelSchemes->getTable($reverseClass); |
| 368 | 368 | $filterColumn = $filterParam->getAttributeName(); |
| 369 | - $aliased = $filterTable . $this->getNewAliasId(); |
|
| 370 | - $joinCondition = $this->buildColumnName($table, $foreignKey) . '=' . |
|
| 369 | + $aliased = $filterTable.$this->getNewAliasId(); |
|
| 370 | + $joinCondition = $this->buildColumnName($table, $foreignKey).'='. |
|
| 371 | 371 | $this->buildColumnName($aliased, $reversePk); |
| 372 | 372 | $builder->innerJoin( |
| 373 | 373 | $quotedTable, |
@@ -397,8 +397,8 @@ discard block |
||
| 397 | 397 | $reverseFk = $modelSchemes->getForeignKey($reverseClass, $reverseName); |
| 398 | 398 | $filterColumn = $filterParam->isForAttributeInRelationship() === true ? |
| 399 | 399 | $filterParam->getAttributeName() : $modelSchemes->getPrimaryKey($reverseClass); |
| 400 | - $aliased = $filterTable . $this->getNewAliasId(); |
|
| 401 | - $joinCondition = $this->buildColumnName($table, $primaryKey) . '=' . |
|
| 400 | + $aliased = $filterTable.$this->getNewAliasId(); |
|
| 401 | + $joinCondition = $this->buildColumnName($table, $primaryKey).'='. |
|
| 402 | 402 | $this->buildColumnName($aliased, $reverseFk); |
| 403 | 403 | $builder->innerJoin( |
| 404 | 404 | $quotedTable, |
@@ -417,8 +417,8 @@ discard block |
||
| 417 | 417 | list ($intermediateTable, $intermediatePk, $intermediateFk) = $modelSchemes |
| 418 | 418 | ->getBelongsToManyRelationship($modelClass, $filterParam->getRelationshipName()); |
| 419 | 419 | $primaryKey = $modelSchemes->getPrimaryKey($modelClass); |
| 420 | - $aliased = $intermediateTable . $this->getNewAliasId(); |
|
| 421 | - $joinCondition = $this->buildColumnName($table, $primaryKey) . '=' . |
|
| 420 | + $aliased = $intermediateTable.$this->getNewAliasId(); |
|
| 421 | + $joinCondition = $this->buildColumnName($table, $primaryKey).'='. |
|
| 422 | 422 | $this->buildColumnName($aliased, $intermediatePk); |
| 423 | 423 | $builder->innerJoin( |
| 424 | 424 | $quotedTable, |
@@ -441,9 +441,9 @@ discard block |
||
| 441 | 441 | $reverseTable = $modelSchemes->getTable($reverseClass); |
| 442 | 442 | $reversePk = $modelSchemes->getPrimaryKey($reverseClass); |
| 443 | 443 | // now join the table with intermediate |
| 444 | - $aliased2 = $reverseTable . $this->getNewAliasId(); |
|
| 445 | - $joinCondition = $this->buildColumnName($aliased, $intermediateFk) . |
|
| 446 | - '=' . $this->buildColumnName($aliased2, $reversePk); |
|
| 444 | + $aliased2 = $reverseTable.$this->getNewAliasId(); |
|
| 445 | + $joinCondition = $this->buildColumnName($aliased, $intermediateFk). |
|
| 446 | + '='.$this->buildColumnName($aliased2, $reversePk); |
|
| 447 | 447 | $builder->innerJoin( |
| 448 | 448 | $aliased, |
| 449 | 449 | $this->buildTableName($reverseTable), |
@@ -668,11 +668,11 @@ discard block |
||
| 668 | 668 | break; |
| 669 | 669 | case 'in': |
| 670 | 670 | $this->getFilterOperations() |
| 671 | - ->applyIn($builder, $link, $errors, $table, $field, (array)$params); |
|
| 671 | + ->applyIn($builder, $link, $errors, $table, $field, (array) $params); |
|
| 672 | 672 | break; |
| 673 | 673 | case 'not-in': |
| 674 | 674 | $this->getFilterOperations() |
| 675 | - ->applyNotIn($builder, $link, $errors, $table, $field, (array)$params); |
|
| 675 | + ->applyNotIn($builder, $link, $errors, $table, $field, (array) $params); |
|
| 676 | 676 | break; |
| 677 | 677 | case self::FILTER_OP_IS_NULL: |
| 678 | 678 | $this->getFilterOperations()->applyIsNull($builder, $link, $table, $field); |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | private function addWhereBind(QueryBuilder $builder, string $table, string $column, string $bindName): void |
| 715 | 715 | { |
| 716 | 716 | $builder |
| 717 | - ->andWhere($this->buildColumnName($table, $column) . '=' . $bindName); |
|
| 717 | + ->andWhere($this->buildColumnName($table, $column).'='.$bindName); |
|
| 718 | 718 | } |
| 719 | 719 | |
| 720 | 720 | /** |
@@ -734,8 +734,8 @@ discard block |
||
| 734 | 734 | |
| 735 | 735 | $builder = $this->getConnection()->createQueryBuilder(); |
| 736 | 736 | |
| 737 | - $aliased = $table . $this->getNewAliasId(); |
|
| 738 | - $joinCondition = $this->buildColumnName($oneTable, $onePrimaryKey) . '=' . |
|
| 737 | + $aliased = $table.$this->getNewAliasId(); |
|
| 738 | + $joinCondition = $this->buildColumnName($oneTable, $onePrimaryKey).'='. |
|
| 739 | 739 | $this->buildColumnName($aliased, $foreignKey); |
| 740 | 740 | $builder |
| 741 | 741 | ->select($this->getColumns($oneClass)) |
@@ -780,8 +780,8 @@ discard block |
||
| 780 | 780 | $reverseTableQuoted = $this->buildTableName($reverseTable); |
| 781 | 781 | $reversePk = $this->getModelSchemes()->getPrimaryKey($reverseClass); |
| 782 | 782 | |
| 783 | - $aliased = $intermediateTable . $this->getNewAliasId(); |
|
| 784 | - $joinCondition = $this->buildColumnName($reverseTable, $reversePk) . '=' . |
|
| 783 | + $aliased = $intermediateTable.$this->getNewAliasId(); |
|
| 784 | + $joinCondition = $this->buildColumnName($reverseTable, $reversePk).'='. |
|
| 785 | 785 | $this->buildColumnName($aliased, $reverseForeignKey); |
| 786 | 786 | $builder = $this->getConnection()->createQueryBuilder(); |
| 787 | 787 | $builder |
@@ -180,10 +180,9 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | $placeholders = null; |
| 182 | 182 | foreach ($values as $value) { |
| 183 | - $placeholders[] = $builder->createNamedParameter((string)$value); |
|
| 183 | + $placeholders[] = $builder->createNamedParameter((string) $value); |
|
| 184 | 184 | } |
| 185 | - $placeholders === null ?: |
|
| 186 | - $link->add($builder->expr()->in($this->getTableColumn($table, $column), $placeholders)); |
|
| 185 | + $placeholders === null ?: $link->add($builder->expr()->in($this->getTableColumn($table, $column), $placeholders)); |
|
| 187 | 186 | } |
| 188 | 187 | |
| 189 | 188 | /** |
@@ -205,10 +204,9 @@ discard block |
||
| 205 | 204 | |
| 206 | 205 | $placeholders = null; |
| 207 | 206 | foreach ($values as $value) { |
| 208 | - $placeholders[] = $builder->createNamedParameter((string)$value); |
|
| 207 | + $placeholders[] = $builder->createNamedParameter((string) $value); |
|
| 209 | 208 | } |
| 210 | - $placeholders === null ?: |
|
| 211 | - $link->add($builder->expr()->notIn($this->getTableColumn($table, $column), $placeholders)); |
|
| 209 | + $placeholders === null ?: $link->add($builder->expr()->notIn($this->getTableColumn($table, $column), $placeholders)); |
|
| 212 | 210 | } |
| 213 | 211 | |
| 214 | 212 | /** |
@@ -258,14 +256,14 @@ discard block |
||
| 258 | 256 | if (is_array($params) === true) { |
| 259 | 257 | foreach ($params as $param) { |
| 260 | 258 | if (is_scalar($param) === true) { |
| 261 | - $param = (string)$builder->createNamedParameter($param); |
|
| 259 | + $param = (string) $builder->createNamedParameter($param); |
|
| 262 | 260 | $link->add($builder->expr()->{$method}($this->getTableColumn($table, $column), $param)); |
| 263 | 261 | } else { |
| 264 | 262 | $this->addInvalidQueryParameterError($errors, $column); |
| 265 | 263 | } |
| 266 | 264 | } |
| 267 | 265 | } elseif (is_scalar($params) === true) { |
| 268 | - $param = $builder->createNamedParameter((string)$params); |
|
| 266 | + $param = $builder->createNamedParameter((string) $params); |
|
| 269 | 267 | $link->add($builder->expr()->{$method}($this->getTableColumn($table, $column), $param)); |
| 270 | 268 | } else { |
| 271 | 269 | // parameter is neither array nor string/scalar |
@@ -49,18 +49,18 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $container[FactoryInterface::class] = $factory; |
| 51 | 51 | |
| 52 | - $container[QueryParametersParserInterface::class] = function () use ($factory) { |
|
| 52 | + $container[QueryParametersParserInterface::class] = function() use ($factory) { |
|
| 53 | 53 | return $factory->getJsonApiFactory()->createQueryParametersParser(); |
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | - $container[JsonSchemesInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 56 | + $container[JsonSchemesInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 57 | 57 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
| 58 | 58 | $modelSchemes = $container->get(ModelSchemeInfoInterface::class); |
| 59 | 59 | |
| 60 | 60 | return $factory->createJsonSchemes($settings[FluteSettings::KEY_MODEL_TO_SCHEME_MAP], $modelSchemes); |
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | - $container[EncoderInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 63 | + $container[EncoderInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 64 | 64 | /** @var JsonSchemesInterface $jsonSchemes */ |
| 65 | 65 | $jsonSchemes = $container->get(JsonSchemesInterface::class); |
| 66 | 66 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | return $encoder; |
| 76 | 76 | }; |
| 77 | 77 | |
| 78 | - $container[FilterOperationsInterface::class] = function (PsrContainerInterface $container) { |
|
| 78 | + $container[FilterOperationsInterface::class] = function(PsrContainerInterface $container) { |
|
| 79 | 79 | return new FilterOperations($container); |
| 80 | 80 | }; |
| 81 | 81 | |
| 82 | - $container[RepositoryInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 82 | + $container[RepositoryInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 83 | 83 | $connection = $container->get(Connection::class); |
| 84 | 84 | /** @var ModelSchemeInfoInterface $modelSchemes */ |
| 85 | 85 | $modelSchemes = $container->get(ModelSchemeInfoInterface::class); |
@@ -94,13 +94,13 @@ discard block |
||
| 94 | 94 | return $factory->createRepository($connection, $modelSchemes, $filerOps, $formatter); |
| 95 | 95 | }; |
| 96 | 96 | |
| 97 | - $container[PaginationStrategyInterface::class] = function (PsrContainerInterface $container) { |
|
| 97 | + $container[PaginationStrategyInterface::class] = function(PsrContainerInterface $container) { |
|
| 98 | 98 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
| 99 | 99 | |
| 100 | 100 | return new PaginationStrategy($settings[FluteSettings::KEY_RELATIONSHIP_PAGING_SIZE]); |
| 101 | 101 | }; |
| 102 | 102 | |
| 103 | - $container[JsonApiValidatorFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
| 103 | + $container[JsonApiValidatorFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
| 104 | 104 | $factory = new JsonApiValidatorFactory($container); |
| 105 | 105 | |
| 106 | 106 | return $factory; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public static function configureExceptionHandler(LimoncelloContainerInterface $container) |
| 127 | 127 | { |
| 128 | - $container[ExceptionHandlerInterface::class] = function () { |
|
| 128 | + $container[ExceptionHandlerInterface::class] = function() { |
|
| 129 | 129 | return new FluteExceptionHandler(); |
| 130 | 130 | }; |
| 131 | 131 | } |
@@ -195,12 +195,12 @@ |
||
| 195 | 195 | return [static::DATA => $data->getData()]; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - $buildUrl = function ($offset) use ($data, $uri) { |
|
| 198 | + $buildUrl = function($offset) use ($data, $uri) { |
|
| 199 | 199 | $paramsWithPaging = [ |
| 200 | 200 | PaginationStrategyInterface::PARAM_PAGING_SKIP => $offset, |
| 201 | 201 | PaginationStrategyInterface::PARAM_PAGING_SIZE => $data->getLimit(), |
| 202 | 202 | ]; |
| 203 | - $fullUrl = $uri . '?' . http_build_query($paramsWithPaging); |
|
| 203 | + $fullUrl = $uri.'?'.http_build_query($paramsWithPaging); |
|
| 204 | 204 | |
| 205 | 205 | return $fullUrl; |
| 206 | 206 | }; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * @inheritdoc |
| 55 | 55 | */ |
| 56 | - public function getRelationshipStorage(): ?RelationshipStorageInterface |
|
| 56 | + public function getRelationshipStorage(): ? RelationshipStorageInterface |
|
| 57 | 57 | { |
| 58 | 58 | return $this->relationshipStorage; |
| 59 | 59 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * @inheritdoc |
| 63 | 63 | */ |
| 64 | - public function setRelationshipStorage(?RelationshipStorageInterface $storage): JsonSchemesInterface |
|
| 64 | + public function setRelationshipStorage(? RelationshipStorageInterface $storage) : JsonSchemesInterface |
|
| 65 | 65 | { |
| 66 | 66 | $this->relationshipStorage = $storage; |
| 67 | 67 | |