@@ -3,20 +3,20 @@ |
||
| 3 | 3 | namespace Limoncello\Flute\Contracts\Models; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * Copyright 2015-2019 [email protected] |
|
| 7 | - * |
|
| 8 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 9 | - * you may not use this file except in compliance with the License. |
|
| 10 | - * You may obtain a copy of the License at |
|
| 11 | - * |
|
| 12 | - * http://www.apache.org/licenses/LICENSE-2.0 |
|
| 13 | - * |
|
| 14 | - * Unless required by applicable law or agreed to in writing, software |
|
| 15 | - * distributed under the License is distributed on an "AS IS" BASIS, |
|
| 16 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 17 | - * See the License for the specific language governing permissions and |
|
| 18 | - * limitations under the License. |
|
| 19 | - */ |
|
| 6 | + * Copyright 2015-2019 [email protected] |
|
| 7 | + * |
|
| 8 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 9 | + * you may not use this file except in compliance with the License. |
|
| 10 | + * You may obtain a copy of the License at |
|
| 11 | + * |
|
| 12 | + * http://www.apache.org/licenses/LICENSE-2.0 |
|
| 13 | + * |
|
| 14 | + * Unless required by applicable law or agreed to in writing, software |
|
| 15 | + * distributed under the License is distributed on an "AS IS" BASIS, |
|
| 16 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 17 | + * See the License for the specific language governing permissions and |
|
| 18 | + * limitations under the License. |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * @package Limoncello\Flute |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Contracts\Models; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Contracts\Validation; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Schema; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Adapters; |
| 4 | 4 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * Condition joining method. |
| 52 | 52 | */ |
| 53 | - public const OR = self::AND + 1; |
|
| 53 | + public const OR = self:: AND + 1; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * @var string |
@@ -465,8 +465,8 @@ discard block |
||
| 465 | 465 | string $relationshipName, |
| 466 | 466 | ?iterable $relationshipFilters, |
| 467 | 467 | ?iterable $relationshipSorts, |
| 468 | - int $joinIndividuals = self::AND, |
|
| 469 | - int $joinRelationship = self::AND |
|
| 468 | + int $joinIndividuals = self:: AND , |
|
| 469 | + int $joinRelationship = self:: AND |
|
| 470 | 470 | ): self { |
| 471 | 471 | $targetAlias = null; |
| 472 | 472 | |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $reversePk = $isBelongsTo === true ? |
| 479 | 479 | $this->getModelSchemas()->getReversePrimaryKey($this->getModelClass(), $relationshipName)[0] : null; |
| 480 | 480 | |
| 481 | - $addWith = $joinIndividuals === self::AND ? $this->expr()->andX() : $this->expr()->orX(); |
|
| 481 | + $addWith = $joinIndividuals === self:: AND ? $this->expr()->andX() : $this->expr()->orX(); |
|
| 482 | 482 | |
| 483 | 483 | foreach ($relationshipFilters as $columnName => $operationsWithArgs) { |
| 484 | 484 | if ($columnName === $reversePk) { |
@@ -498,14 +498,14 @@ discard block |
||
| 498 | 498 | foreach ($operationsWithArgs as $operation => $arguments) { |
| 499 | 499 | assert( |
| 500 | 500 | is_iterable($arguments) === true || is_array($arguments) === true, |
| 501 | - "Operation arguments are missing for `$columnName` column. " . |
|
| 501 | + "Operation arguments are missing for `$columnName` column. ". |
|
| 502 | 502 | 'Use an empty array as an empty argument list.' |
| 503 | 503 | ); |
| 504 | 504 | $addWith->add($this->createFilterExpression($fullColumnName, $operation, $arguments)); |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | if ($addWith->count() > 0) { |
| 508 | - $joinRelationship === self::AND ? $this->andWhere($addWith) : $this->orWhere($addWith); |
|
| 508 | + $joinRelationship === self:: AND ? $this->andWhere($addWith) : $this->orWhere($addWith); |
|
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | } |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | foreach ($operationsWithArgs as $operation => $arguments) { |
| 647 | 647 | assert( |
| 648 | 648 | is_iterable($arguments) === true || is_array($arguments) === true, |
| 649 | - "Operation arguments are missing for `$columnName` column. " . |
|
| 649 | + "Operation arguments are missing for `$columnName` column. ". |
|
| 650 | 650 | 'Use an empty array as an empty argument list.' |
| 651 | 651 | ); |
| 652 | 652 | $expression->add($this->createFilterExpression($fullColumnName, $operation, $arguments)); |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | { |
| 700 | 700 | $platform = $this->getConnection()->getDatabasePlatform(); |
| 701 | 701 | |
| 702 | - return $platform->quoteSingleIdentifier($tableOrAlias) . '.' . $platform->quoteSingleIdentifier($column); |
|
| 702 | + return $platform->quoteSingleIdentifier($tableOrAlias).'.'.$platform->quoteSingleIdentifier($column); |
|
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | /** |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | */ |
| 742 | 742 | public function createAlias(string $tableName): string |
| 743 | 743 | { |
| 744 | - $alias = $tableName . (++$this->aliasIdCounter); |
|
| 744 | + $alias = $tableName.(++$this->aliasIdCounter); |
|
| 745 | 745 | $this->knownAliases[$tableName] = $alias; |
| 746 | 746 | |
| 747 | 747 | return $alias; |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | string $targetColumn |
| 765 | 765 | ): string { |
| 766 | 766 | $targetAlias = $this->createAlias($targetTable); |
| 767 | - $joinCondition = $this->quoteDoubleIdentifier($fromAlias, $fromColumn) . '=' . |
|
| 767 | + $joinCondition = $this->quoteDoubleIdentifier($fromAlias, $fromColumn).'='. |
|
| 768 | 768 | $this->quoteDoubleIdentifier($targetAlias, $targetColumn); |
| 769 | 769 | |
| 770 | 770 | $this->innerJoin( |
@@ -977,7 +977,7 @@ discard block |
||
| 977 | 977 | } else { |
| 978 | 978 | assert( |
| 979 | 979 | $value !== null, |
| 980 | - 'It seems you are trying to use `null` with =, >, <, or etc operator. ' . |
|
| 980 | + 'It seems you are trying to use `null` with =, >, <, or etc operator. '. |
|
| 981 | 981 | 'Use `is null` or `not null` instead.' |
| 982 | 982 | ); |
| 983 | 983 | assert(is_string($value), "Only strings, booleans and integers are supported."); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | - * @param iterable $attributes |
|
| 236 | + * @param \Generator $attributes |
|
| 237 | 237 | * |
| 238 | 238 | * @return self |
| 239 | 239 | * |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
| 258 | - * @param iterable $attributes |
|
| 258 | + * @param \Generator $attributes |
|
| 259 | 259 | * |
| 260 | 260 | * @return self |
| 261 | 261 | * |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * @param string $modelClass |
| 279 | 279 | * @param iterable $attributes |
| 280 | 280 | * |
| 281 | - * @return iterable |
|
| 281 | + * @return \Generator |
|
| 282 | 282 | * |
| 283 | 283 | * @SuppressWarnings(PHPMD.StaticAccess) |
| 284 | 284 | * |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /** |
| 416 | - * @param iterable $filters |
|
| 416 | + * @param \Limoncello\Flute\Api\iterable|null $filters |
|
| 417 | 417 | * |
| 418 | 418 | * @return self |
| 419 | 419 | * |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | /** |
| 432 | - * @param iterable $filters |
|
| 432 | + * @param \Limoncello\Flute\Api\iterable|null $filters |
|
| 433 | 433 | * |
| 434 | 434 | * @return self |
| 435 | 435 | * |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /** |
| 448 | - * @param iterable $filters |
|
| 448 | + * @param \Limoncello\Flute\Api\iterable|null $filters |
|
| 449 | 449 | * |
| 450 | 450 | * @return self |
| 451 | 451 | * |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Api; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Package; |
| 4 | 4 | |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | ); |
| 105 | 105 | assert(empty($jsonQueryValFileMask) === false, "Invalid Query Validators file mask `$jsonQueryValFileMask`."); |
| 106 | 106 | |
| 107 | - $schemasPath = $schemasFolder . DIRECTORY_SEPARATOR . $schemasFileMask; |
|
| 108 | - $jsonDataValPath = $jsonDataValFolder . DIRECTORY_SEPARATOR . $jsonDataValFileMask; |
|
| 109 | - $formsValidatorsPath = $formsValFolder . DIRECTORY_SEPARATOR . $formsValFileMask; |
|
| 110 | - $jsonQueryValPath = $jsonQueryValFolder . DIRECTORY_SEPARATOR . $jsonQueryValFileMask; |
|
| 107 | + $schemasPath = $schemasFolder.DIRECTORY_SEPARATOR.$schemasFileMask; |
|
| 108 | + $jsonDataValPath = $jsonDataValFolder.DIRECTORY_SEPARATOR.$jsonDataValFileMask; |
|
| 109 | + $formsValidatorsPath = $formsValFolder.DIRECTORY_SEPARATOR.$formsValFileMask; |
|
| 110 | + $jsonQueryValPath = $jsonQueryValFolder.DIRECTORY_SEPARATOR.$jsonQueryValFileMask; |
|
| 111 | 111 | |
| 112 | 112 | $requireUniqueTypes = $defaults[static::KEY_SCHEMAS_REQUIRE_UNIQUE_TYPES] ?? true; |
| 113 | 113 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Package; |
| 4 | 4 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $container[FactoryInterface::class] = $factory; |
| 57 | 57 | |
| 58 | - $container[JsonSchemasInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 58 | + $container[JsonSchemasInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 59 | 59 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
| 60 | 60 | $modelSchemas = $container->get(ModelSchemaInfoInterface::class); |
| 61 | 61 | |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | ); |
| 67 | 67 | }; |
| 68 | 68 | |
| 69 | - $container[ParametersMapperInterface::class] = function (PsrContainerInterface $container) { |
|
| 69 | + $container[ParametersMapperInterface::class] = function(PsrContainerInterface $container) { |
|
| 70 | 70 | return new ParametersMapper($container->get(JsonSchemasInterface::class)); |
| 71 | 71 | }; |
| 72 | 72 | |
| 73 | - $container[EncoderInterface::class] = function (PsrContainerInterface $container) use ($factory) { |
|
| 73 | + $container[EncoderInterface::class] = function(PsrContainerInterface $container) use ($factory) { |
|
| 74 | 74 | /** @var JsonSchemasInterface $jsonSchemas */ |
| 75 | 75 | $jsonSchemas = $container->get(JsonSchemasInterface::class); |
| 76 | 76 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
@@ -86,19 +86,19 @@ discard block |
||
| 86 | 86 | return $encoder; |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | - $container[RelationshipPaginationStrategyInterface::class] = function (PsrContainerInterface $container) { |
|
| 89 | + $container[RelationshipPaginationStrategyInterface::class] = function(PsrContainerInterface $container) { |
|
| 90 | 90 | $settings = $container->get(SettingsProviderInterface::class)->get(FluteSettings::class); |
| 91 | 91 | |
| 92 | 92 | return new BasicRelationshipPaginationStrategy($settings[FluteSettings::KEY_DEFAULT_PAGING_SIZE]); |
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | - $container[JsonApiParserFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
| 95 | + $container[JsonApiParserFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
| 96 | 96 | $factory = new JsonApiParserFactory($container); |
| 97 | 97 | |
| 98 | 98 | return $factory; |
| 99 | 99 | }; |
| 100 | 100 | |
| 101 | - $container[FormValidatorFactoryInterface::class] = function (PsrContainerInterface $container) { |
|
| 101 | + $container[FormValidatorFactoryInterface::class] = function(PsrContainerInterface $container) { |
|
| 102 | 102 | $factory = new FormValidatorFactory($container); |
| 103 | 103 | |
| 104 | 104 | return $factory; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public static function configureExceptionHandler(LimoncelloContainerInterface $container) |
| 118 | 118 | { |
| 119 | - $container[ThrowableHandlerInterface::class] = function (PsrContainerInterface $container) { |
|
| 119 | + $container[ThrowableHandlerInterface::class] = function(PsrContainerInterface $container) { |
|
| 120 | 120 | /** @var CacheSettingsProviderInterface $provider */ |
| 121 | 121 | $provider = $container->get(CacheSettingsProviderInterface::class); |
| 122 | 122 | $appConfig = $provider->getApplicationConfiguration(); |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Package; |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare (strict_types = 1); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace Limoncello\Flute\Exceptions; |
| 4 | 4 | |