From 22ec5cadfc968df954bcab7c9dcee2ddc5f33fe7 Mon Sep 17 00:00:00 2001 From: LaravelFreelancerNL Date: Mon, 4 Dec 2023 11:40:28 +0000 Subject: [PATCH] Fix styling --- src/AQL/HasArangoSearchFunctions.php | 15 +-------------- src/AQL/HasArrayFunctions.php | 16 ---------------- src/AQL/HasDateFunctions.php | 4 ++-- src/AQL/HasDocumentFunctions.php | 4 ---- src/AQL/HasGeoFunctions.php | 8 -------- src/AQL/HasGraphClauses.php | 2 +- src/AQL/HasQueryClauses.php | 4 ++-- src/AQL/HasStringFunctions.php | 8 +++----- src/Clauses/PruneClause.php | 2 +- src/Clauses/TraverseClause.php | 2 -- src/Clauses/UpdateClause.php | 4 ---- src/Clauses/WindowClause.php | 2 +- src/Expressions/ArithmeticExpression.php | 7 ------- src/Expressions/BindExpression.php | 3 --- src/Expressions/BooleanExpression.php | 3 --- src/Expressions/ConstantExpression.php | 3 --- src/Expressions/Expression.php | 2 -- src/Expressions/FunctionExpression.php | 2 -- src/Expressions/LiteralExpression.php | 3 --- src/Expressions/NullExpression.php | 3 --- src/Expressions/PredicateExpression.php | 7 +++---- src/Expressions/TernaryExpression.php | 2 -- src/QueryBuilder.php | 9 ++++----- src/QueryElement.php | 3 --- src/Traits/CompilesPredicates.php | 2 -- src/Traits/NormalizesExpressions.php | 14 ++++++-------- src/Traits/ValidatesExpressions.php | 9 --------- src/Traits/ValidatesOperators.php | 12 ------------ .../Unit/Expressions/PredicateExpressionTest.php | 4 ++-- 29 files changed, 26 insertions(+), 133 deletions(-) diff --git a/src/AQL/HasArangoSearchFunctions.php b/src/AQL/HasArangoSearchFunctions.php index 8af7063..e19f4ac 100644 --- a/src/AQL/HasArangoSearchFunctions.php +++ b/src/AQL/HasArangoSearchFunctions.php @@ -110,14 +110,10 @@ public function tfidf( * Match documents where the attribute at path is present and is of the specified data type. * * https://www.arangodb.com/docs/stable/aql/functions-arangosearch.html#exists - * - * @param Expression|QueryBuilder|string $path - * @param Expression|QueryBuilder|null|string $type - * @return FunctionExpression */ public function exists( Expression|QueryBuilder|string $path, - Expression|null|string|QueryBuilder $type = null + Expression|string|QueryBuilder $type = null ): FunctionExpression { $arguments = [ $path, @@ -132,13 +128,6 @@ public function exists( * Match documents where the attribute at path is present and is of the specified data type. * * https://www.arangodb.com/docs/stable/aql/functions-arangosearch.html#in_range - * - * @param string|Expression $path - * @param int|float|string|Expression|QueryBuilder $low - * @param int|float|string|Expression|QueryBuilder $high - * @param bool|Expression|QueryBuilder|null $includeLow - * @param bool|Expression|QueryBuilder|null $includeHigh - * @return FunctionExpression */ public function inRange( string|Expression $path, @@ -171,7 +160,6 @@ public function inRange( * @param null|bool|object $transpositions * @param null|int|object $maxTerms * @param null|string|object $prefix - * @return FunctionExpression */ public function levenshteinMatch( mixed $path, @@ -221,7 +209,6 @@ public function like( * @param string|object $target * @param null|int|float|object $threshold * @param null|string|object $analyzer - * @return FunctionExpression */ public function nGramMatch( mixed $path, diff --git a/src/AQL/HasArrayFunctions.php b/src/AQL/HasArrayFunctions.php index dea2a82..1dcd1fa 100644 --- a/src/AQL/HasArrayFunctions.php +++ b/src/AQL/HasArrayFunctions.php @@ -21,9 +21,6 @@ trait HasArrayFunctions * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#append * * @param array|object $array - * @param mixed $values - * @param bool|null $unique - * @return FunctionExpression */ public function append(mixed $array, mixed $values, bool $unique = null): FunctionExpression { @@ -44,7 +41,6 @@ public function append(mixed $array, mixed $values, bool $unique = null): Functi * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#length * * @param mixed $value - * @return FunctionExpression */ public function count($value): FunctionExpression { @@ -57,7 +53,6 @@ public function count($value): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#count_distinct * * @param mixed $value - * @return FunctionExpression */ public function countDistinct($value): FunctionExpression { @@ -70,7 +65,6 @@ public function countDistinct($value): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#first * * @param mixed $value - * @return FunctionExpression */ public function first($value): FunctionExpression { @@ -84,7 +78,6 @@ public function first($value): FunctionExpression * * @param array|object $array * @param int|object $depth - * @return FunctionExpression */ public function flatten(mixed $array, mixed $depth = 1): FunctionExpression { @@ -102,7 +95,6 @@ public function flatten(mixed $array, mixed $depth = 1): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#intersection * * @param array ...$arrays - * @return FunctionExpression */ public function intersection(array ...$arrays): FunctionExpression { @@ -115,7 +107,6 @@ public function intersection(array ...$arrays): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#last * * @param mixed $value - * @return FunctionExpression */ public function last($value): FunctionExpression { @@ -124,9 +115,6 @@ public function last($value): FunctionExpression /** * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#length - * - * @param mixed $value - * @return FunctionExpression */ public function length(mixed $value): FunctionExpression { @@ -139,7 +127,6 @@ public function length(mixed $value): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#shift * * @param array|object $array - * @return FunctionExpression */ public function shift(mixed $array): FunctionExpression { @@ -152,7 +139,6 @@ public function shift(mixed $array): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#union * * @param array|Expression|QueryBuilder $arrays - * @return FunctionExpression */ public function union( array|Expression|QueryBuilder ...$arrays @@ -166,7 +152,6 @@ public function union( * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#union_distinct * * @param array|Expression|QueryBuilder $arrays - * @return FunctionExpression */ public function unionDistinct( array|Expression|QueryBuilder ...$arrays @@ -180,7 +165,6 @@ public function unionDistinct( * @link https://www.arangodb.com/docs/stable/aql/functions-array.html#unique * * @param array|object $array - * @return FunctionExpression */ public function unique(mixed $array): FunctionExpression { diff --git a/src/AQL/HasDateFunctions.php b/src/AQL/HasDateFunctions.php index dbf963d..4ce8c03 100644 --- a/src/AQL/HasDateFunctions.php +++ b/src/AQL/HasDateFunctions.php @@ -202,7 +202,7 @@ public function dateRound( public function dateUtcToLocal( int|string|object $date, string|object $timezone, - null|array|object $zoneInfo = null + array|object $zoneInfo = null ): FunctionExpression { $arguments = [ 'date' => $date, @@ -225,7 +225,7 @@ public function dateUtcToLocal( public function dateLocalToUtc( int|string|object $date, string|object $timezone, - null|array|object $zoneInfo = null + array|object $zoneInfo = null ): FunctionExpression { $arguments = [ 'date' => $date, diff --git a/src/AQL/HasDocumentFunctions.php b/src/AQL/HasDocumentFunctions.php index cae73af..d9450f3 100644 --- a/src/AQL/HasDocumentFunctions.php +++ b/src/AQL/HasDocumentFunctions.php @@ -68,8 +68,6 @@ public function keepAttributes( * * @param array|object $document * @param array|object $examples - * @param bool|QueryBuilder|Expression $returnIndex - * @return FunctionExpression */ public function matches( array|object $document, @@ -91,7 +89,6 @@ public function matches( * @link https://www.arangodb.com/docs/stable/aql/functions-document.html#merge * * @param array|string|Expression $documents - * @return FunctionExpression */ public function merge(string|array|Expression ...$documents): FunctionExpression { @@ -104,7 +101,6 @@ public function merge(string|array|Expression ...$documents): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-document.html#parse_identifier * * @param string|object $documentHandle - * @return FunctionExpression */ public function parseIdentifier(mixed $documentHandle): FunctionExpression { diff --git a/src/AQL/HasGeoFunctions.php b/src/AQL/HasGeoFunctions.php index f10344d..9a1684f 100644 --- a/src/AQL/HasGeoFunctions.php +++ b/src/AQL/HasGeoFunctions.php @@ -24,7 +24,6 @@ trait HasGeoFunctions * @param mixed $longitude1 * @param mixed $latitude2 * @param mixed $longitude2 - * @return FunctionExpression */ public function distance($latitude1, $longitude1, $latitude2, $longitude2): FunctionExpression { @@ -83,7 +82,6 @@ public function geoDistance( * * @param string|array|object $geoJsonA * @param string|array|object $geoJsonB - * @return FunctionExpression */ public function geoEquals( string|array|object $geoJsonA, @@ -99,7 +97,6 @@ public function geoEquals( * * @param string|array|object|object $geoJsonA * @param string|array|object|object $geoJsonB - * @return FunctionExpression */ public function geoIntersects(mixed $geoJsonA, mixed $geoJsonB): FunctionExpression { @@ -142,7 +139,6 @@ public function geoInRange( * @link https://www.arangodb.com/docs/stable/aql/functions-geo.html#geo_linestring * * @param array|object $points - * @return FunctionExpression */ public function geoLineString(mixed $points): FunctionExpression { @@ -156,7 +152,6 @@ public function geoLineString(mixed $points): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-geo.html#geo_multilinestring * * @param array|object $points - * @return FunctionExpression */ public function geoMultiLineString(mixed $points): FunctionExpression { @@ -181,7 +176,6 @@ public function geoPoint( * @link https://www.arangodb.com/docs/stable/aql/functions-geo.html#geo_multipoint * * @param array|object $points - * @return FunctionExpression */ public function geoMultiPoint(mixed $points): FunctionExpression { @@ -194,7 +188,6 @@ public function geoMultiPoint(mixed $points): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-geo.html#geo_polygon * * @param array|object $points - * @return FunctionExpression */ public function geoPolygon(mixed $points): FunctionExpression { @@ -207,7 +200,6 @@ public function geoPolygon(mixed $points): FunctionExpression * @link https://www.arangodb.com/docs/stable/aql/functions-geo.html#geo_polygon * * @param array|object $points - * @return FunctionExpression */ public function geoMultiPolygon(mixed $points): FunctionExpression { diff --git a/src/AQL/HasGraphClauses.php b/src/AQL/HasGraphClauses.php index b27bd54..88796fd 100644 --- a/src/AQL/HasGraphClauses.php +++ b/src/AQL/HasGraphClauses.php @@ -142,7 +142,7 @@ public function edgeCollections(): self public function prune( object|array|string|int|float|bool|null $leftOperand, string|QueryBuilder|Expression $comparisonOperator = null, - object|array|string|int|float|bool|null $rightOperand = null, + object|array|string|int|float|bool $rightOperand = null, string|QueryBuilder|Expression $logicalOperator = null, string $pruneVariable = null ): self { diff --git a/src/AQL/HasQueryClauses.php b/src/AQL/HasQueryClauses.php index 3a5540e..81fcba8 100644 --- a/src/AQL/HasQueryClauses.php +++ b/src/AQL/HasQueryClauses.php @@ -60,7 +60,7 @@ public function for( public function filter( object|array|string|int|float|bool|null $leftOperand, string $comparisonOperator = null, - object|array|string|int|float|bool|null $rightOperand = null, + object|array|string|int|float|bool $rightOperand = null, string $logicalOperator = null ): self { $predicates = $leftOperand; @@ -84,7 +84,7 @@ public function filter( public function search( object|array|string|int|float|bool|null $leftOperand, string $comparisonOperator = null, - object|array|string|int|float|bool|null $rightOperand = null, + object|array|string|int|float|bool $rightOperand = null, string $logicalOperator = null ): self { $predicates = $leftOperand; diff --git a/src/AQL/HasStringFunctions.php b/src/AQL/HasStringFunctions.php index 37d0edc..61dce68 100644 --- a/src/AQL/HasStringFunctions.php +++ b/src/AQL/HasStringFunctions.php @@ -31,9 +31,7 @@ public function concat( * * @link https://www.arangodb.com/docs/stable/aql/functions-string.html#concat_separator * - * @param string|Expression|QueryBuilder $separator * @param array|Expression|QueryBuilder> ...$values - * @return FunctionExpression */ public function concatSeparator( string|Expression|QueryBuilder $separator, @@ -139,7 +137,7 @@ public function lower( */ public function ltrim( string|object $value, - null|string|object $char = null + string|object $char = null ): FunctionExpression { $arguments = [ 'value' => $value, @@ -227,7 +225,7 @@ public function regexTest( */ public function rtrim( string|object $value, - null|string|object $char = null + string|object $char = null ): FunctionExpression { $arguments = [ 'value' => $value, @@ -339,7 +337,7 @@ public function tokens( */ public function trim( string|object $value, - null|string|int|object $type = null + string|int|object $type = null ): FunctionExpression { $arguments = [ 'value' => $value, diff --git a/src/Clauses/PruneClause.php b/src/Clauses/PruneClause.php index f3403a2..5a6132e 100644 --- a/src/Clauses/PruneClause.php +++ b/src/Clauses/PruneClause.php @@ -38,6 +38,6 @@ public function compile(QueryBuilder $queryBuilder): string $compiledPredicates = $queryBuilder->compilePredicates($this->predicates); - return $aql.rtrim($compiledPredicates); + return $aql.rtrim($compiledPredicates); } } diff --git a/src/Clauses/TraverseClause.php b/src/Clauses/TraverseClause.php index a5413f7..63ce4cc 100644 --- a/src/Clauses/TraverseClause.php +++ b/src/Clauses/TraverseClause.php @@ -53,8 +53,6 @@ public function compile(QueryBuilder $queryBuilder): string /** * Default path type - * - * @return string */ protected function traverseType(): string { diff --git a/src/Clauses/UpdateClause.php b/src/Clauses/UpdateClause.php index 66eeb9c..1af59c3 100644 --- a/src/Clauses/UpdateClause.php +++ b/src/Clauses/UpdateClause.php @@ -19,15 +19,11 @@ class UpdateClause extends Clause */ protected array|object|string $with; - /** - * @var string|QueryBuilder|Expression - */ protected string|QueryBuilder|Expression $collection; /** * @param array|object|string $document * @param array|object|string $with - * @param string|QueryBuilder|Expression $collection */ public function __construct( array|object|string $document, diff --git a/src/Clauses/WindowClause.php b/src/Clauses/WindowClause.php index 99f0049..fbc5b25 100644 --- a/src/Clauses/WindowClause.php +++ b/src/Clauses/WindowClause.php @@ -24,7 +24,7 @@ class WindowClause extends Clause */ public function __construct( array|object $offsets, - null|string|QueryBuilder|Expression $rangeValue = null + string|QueryBuilder|Expression $rangeValue = null ) { parent::__construct(); diff --git a/src/Expressions/ArithmeticExpression.php b/src/Expressions/ArithmeticExpression.php index e31f9f9..85ecc09 100644 --- a/src/Expressions/ArithmeticExpression.php +++ b/src/Expressions/ArithmeticExpression.php @@ -16,10 +16,6 @@ class ArithmeticExpression extends Expression implements ExpressionInterface /** * Create predicate expression. - * - * @param int|float|null|Expression|QueryBuilder $leftOperand - * @param string $operator - * @param int|float|null|Expression|QueryBuilder $rightOperand */ public function __construct( int|float|null|Expression|QueryBuilder $leftOperand, @@ -32,8 +28,6 @@ public function __construct( /** * Compile calculation. * - * @param QueryBuilder $queryBuilder - * @return string * * @throws \Exception */ @@ -58,7 +52,6 @@ public function compile(QueryBuilder $queryBuilder): string } /** - * @param QueryBuilder $queryBuilder * @param array $calculation * @return array * diff --git a/src/Expressions/BindExpression.php b/src/Expressions/BindExpression.php index 94b0aca..9df65e3 100644 --- a/src/Expressions/BindExpression.php +++ b/src/Expressions/BindExpression.php @@ -24,9 +24,6 @@ public function __construct(string $bindVariable, mixed $data = null) /** * Compile expression output. - * - * @param QueryBuilder $queryBuilder - * @return string */ public function compile(QueryBuilder $queryBuilder): string { diff --git a/src/Expressions/BooleanExpression.php b/src/Expressions/BooleanExpression.php index 38bae43..d69e0eb 100644 --- a/src/Expressions/BooleanExpression.php +++ b/src/Expressions/BooleanExpression.php @@ -13,9 +13,6 @@ class BooleanExpression extends LiteralExpression implements ExpressionInterface { /** * Compile expression output. - * - * @param QueryBuilder|null $queryBuilder - * @return string */ public function compile(QueryBuilder $queryBuilder = null): string { diff --git a/src/Expressions/ConstantExpression.php b/src/Expressions/ConstantExpression.php index 9058e52..31a1c74 100644 --- a/src/Expressions/ConstantExpression.php +++ b/src/Expressions/ConstantExpression.php @@ -13,9 +13,6 @@ class ConstantExpression extends LiteralExpression implements ExpressionInterfac { /** * Compile expression output. - * - * @param QueryBuilder|null $queryBuilder - * @return string */ public function compile(QueryBuilder $queryBuilder = null): string { diff --git a/src/Expressions/Expression.php b/src/Expressions/Expression.php index 4f26393..aae7882 100644 --- a/src/Expressions/Expression.php +++ b/src/Expressions/Expression.php @@ -15,8 +15,6 @@ abstract class Expression extends QueryElement /** * Create an expression. - * - * @param mixed $expression */ public function __construct(mixed $expression) { diff --git a/src/Expressions/FunctionExpression.php b/src/Expressions/FunctionExpression.php index e02603d..6b18a3a 100644 --- a/src/Expressions/FunctionExpression.php +++ b/src/Expressions/FunctionExpression.php @@ -24,7 +24,6 @@ class FunctionExpression extends Expression implements ExpressionInterface /** * FunctionExpression constructor. * - * @param string $functionName * @param array|object|scalar|null $parameters */ public function __construct( @@ -56,7 +55,6 @@ public function compile(QueryBuilder $queryBuilder): string /** * @param array $parameters - * @param QueryBuilder $queryBuilder * @return array */ protected function compileParameters( diff --git a/src/Expressions/LiteralExpression.php b/src/Expressions/LiteralExpression.php index 9275dac..f94e5f8 100644 --- a/src/Expressions/LiteralExpression.php +++ b/src/Expressions/LiteralExpression.php @@ -13,9 +13,6 @@ class LiteralExpression extends Expression implements ExpressionInterface { /** * Compile expression output. - * - * @param QueryBuilder $queryBuilder - * @return string */ public function compile(QueryBuilder $queryBuilder): string { diff --git a/src/Expressions/NullExpression.php b/src/Expressions/NullExpression.php index ca1bac3..d636724 100644 --- a/src/Expressions/NullExpression.php +++ b/src/Expressions/NullExpression.php @@ -20,9 +20,6 @@ public function __construct() /** * Compile expression output. - * - * @param QueryBuilder|null $queryBuilder - * @return string */ public function compile(QueryBuilder $queryBuilder = null): string { diff --git a/src/Expressions/PredicateExpression.php b/src/Expressions/PredicateExpression.php index 98fde31..fe23706 100644 --- a/src/Expressions/PredicateExpression.php +++ b/src/Expressions/PredicateExpression.php @@ -14,7 +14,7 @@ class PredicateExpression extends Expression implements ExpressionInterface */ protected object|array|string|int|float|bool|null $leftOperand; - protected string|null $comparisonOperator; + protected ?string $comparisonOperator; /** * @var object|array|string|int|float|bool|null @@ -29,12 +29,11 @@ class PredicateExpression extends Expression implements ExpressionInterface * @param object|array|string|int|float|bool|null $leftOperand * @param ?string $comparisonOperator * @param object|array|string|int|float|bool|null $rightOperand - * @param string $logicalOperator */ public function __construct( object|array|string|int|float|bool|null $leftOperand, - ?string $comparisonOperator = null, - object|array|string|int|float|bool|null $rightOperand = null, + string $comparisonOperator = null, + object|array|string|int|float|bool $rightOperand = null, string $logicalOperator = 'AND' ) { $this->leftOperand = $leftOperand; diff --git a/src/Expressions/TernaryExpression.php b/src/Expressions/TernaryExpression.php index a123fc9..2ee092a 100644 --- a/src/Expressions/TernaryExpression.php +++ b/src/Expressions/TernaryExpression.php @@ -19,8 +19,6 @@ class TernaryExpression extends Expression implements ExpressionInterface /** * @param array|PredicateExpression $predicates - * @param mixed $then - * @param mixed|null $else */ public function __construct( array|PredicateExpression $predicates, diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index e417bfa..3cdc8f4 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -26,14 +26,14 @@ */ class QueryBuilder { - use NormalizesExpressions; use CompilesPredicates; - use HasQueryClauses; - use HasStatementClauses; - use HasGraphClauses; use HasFunctions; + use HasGraphClauses; use HasOperatorExpressions; + use HasQueryClauses; + use HasStatementClauses; use HasSupportCommands; + use NormalizesExpressions; /** * The database query grammar instance. @@ -136,7 +136,6 @@ public function removeCommand(int $index = null): bool /** * @param mixed $collections * @param string $mode - * @return QueryBuilder */ public function registerCollections($collections, $mode = 'write'): self { diff --git a/src/QueryElement.php b/src/QueryElement.php index 53da2c4..23472de 100644 --- a/src/QueryElement.php +++ b/src/QueryElement.php @@ -8,9 +8,6 @@ abstract class QueryElement { /** * Compile clause|expression output. - * - * @param QueryBuilder $queryBuilder - * @return string */ abstract public function compile(QueryBuilder $queryBuilder): string; } diff --git a/src/Traits/CompilesPredicates.php b/src/Traits/CompilesPredicates.php index 5006811..43cee55 100644 --- a/src/Traits/CompilesPredicates.php +++ b/src/Traits/CompilesPredicates.php @@ -45,8 +45,6 @@ protected function compilePredicate(PredicateExpression $predicate, int $positio /** * @param array $predicates - * @param int $position - * @return string */ protected function compilePredicateGroup( array $predicates, diff --git a/src/Traits/NormalizesExpressions.php b/src/Traits/NormalizesExpressions.php index d16eb4b..0441baf 100644 --- a/src/Traits/NormalizesExpressions.php +++ b/src/Traits/NormalizesExpressions.php @@ -60,7 +60,7 @@ public function normalizeArgument( */ protected function normalizeScalar( array|string|int|float|bool $argument, - null|array|string $allowedExpressionTypes = null + array|string $allowedExpressionTypes = null ): Expression { $argumentType = $this->determineArgumentType($argument, $allowedExpressionTypes); @@ -94,14 +94,13 @@ protected function createExpression( /** * @param array|object $argument * @param array|string|null $allowedExpressionTypes - * @return Expression * * @throws ExpressionTypeException * @throws BindException */ protected function normalizeCompound( array|object $argument, - null|array|string $allowedExpressionTypes = null + array|string $allowedExpressionTypes = null ): Expression { if (is_array($argument)) { return $this->normalizeArray($argument, $allowedExpressionTypes); @@ -124,7 +123,7 @@ protected function normalizeCompound( */ protected function normalizeIterable( array $argument, - null|array|string $allowedExpressionTypes = null + array|string $allowedExpressionTypes = null ): array { $result = []; /** @var mixed $value */ @@ -163,7 +162,6 @@ public function normalizePredicates( /** * @param array|PredicateExpression $predicate - * @return PredicateExpression * * @throws ExpressionTypeException|BindException */ @@ -213,7 +211,7 @@ protected function normalizePredicate(array|PredicateExpression $predicate): Pre */ protected function determineArgumentType( mixed $argument, - null|array|string $allowedExpressionTypes = null + array|string $allowedExpressionTypes = null ): string { if (is_string($allowedExpressionTypes)) { $allowedExpressionTypes = [$allowedExpressionTypes]; @@ -258,7 +256,7 @@ protected function determineArgumentType( */ protected function normalizeArray( array $argument, - null|array|string $allowedExpressionTypes = null + array|string $allowedExpressionTypes = null ): Expression { if ($this->grammar->isAssociativeArray($argument)) { return new ObjectExpression($this->normalizeIterable($argument, $allowedExpressionTypes)); @@ -275,7 +273,7 @@ protected function normalizeArray( */ protected function normalizeObject( object $argument, - null|array|string $allowedExpressionTypes = null + array|string $allowedExpressionTypes = null ): Expression { if ($argument instanceof DateTimeInterface) { return new StringExpression($argument->format(DateTimeInterface::ATOM)); diff --git a/src/Traits/ValidatesExpressions.php b/src/Traits/ValidatesExpressions.php index 750ec9a..7f56fee 100644 --- a/src/Traits/ValidatesExpressions.php +++ b/src/Traits/ValidatesExpressions.php @@ -49,7 +49,6 @@ public function isQuery(mixed $value): bool /** * @param mixed $value - * @return bool */ public function isFunction($value): bool { @@ -58,7 +57,6 @@ public function isFunction($value): bool /** * @param mixed $value - * @return bool */ public function isSortDirection($value): bool { @@ -71,7 +69,6 @@ public function isSortDirection($value): bool /** * @param mixed $value - * @return bool */ public function isGraphDirection($value): bool { @@ -84,7 +81,6 @@ public function isGraphDirection($value): bool /** * @param mixed $value - * @return bool */ public function isCollection($value): bool { @@ -97,7 +93,6 @@ public function isCollection($value): bool /** * @param mixed $value - * @return bool */ public function isGraph($value): bool { @@ -106,7 +101,6 @@ public function isGraph($value): bool /** * @param mixed $value - * @return bool */ public function isKey($value): bool { @@ -122,7 +116,6 @@ public function isKey($value): bool /** * @param mixed $value - * @return bool */ public function isId($value): bool { @@ -158,7 +151,6 @@ public function isBindParameter(string $bindParameter): bool * Check if the array is associative. * * @param array $array - * @return bool */ public function isAssociativeArray(array $array): bool { @@ -173,7 +165,6 @@ public function isAssociativeArray(array $array): bool * Check if the array is numeric. * * @param array $array - * @return bool */ public function isIndexedArray(array $array): bool { diff --git a/src/Traits/ValidatesOperators.php b/src/Traits/ValidatesOperators.php index b05999c..3dcc4b3 100644 --- a/src/Traits/ValidatesOperators.php +++ b/src/Traits/ValidatesOperators.php @@ -6,28 +6,16 @@ trait ValidatesOperators { - /** - * @param string $operator - * @return bool - */ public function isLogicalOperator(string $operator): bool { return isset($this->logicalOperators[strtoupper($operator)]); } - /** - * @param string $operator - * @return bool - */ public function isComparisonOperator(string $operator): bool { return isset($this->comparisonOperators[strtoupper($operator)]); } - /** - * @param string $operator - * @return bool - */ public function isArithmeticOperator(string $operator): bool { return isset($this->arithmeticOperators[$operator]); diff --git a/tests/Unit/Expressions/PredicateExpressionTest.php b/tests/Unit/Expressions/PredicateExpressionTest.php index af6d1af..6d710de 100644 --- a/tests/Unit/Expressions/PredicateExpressionTest.php +++ b/tests/Unit/Expressions/PredicateExpressionTest.php @@ -78,8 +78,8 @@ public function testGroupOfPredicateExpressions() ); $result = $qb->for('u', 'users') - ->filter([$predicate1, $predicate2]) - ->return('u'); + ->filter([$predicate1, $predicate2]) + ->return('u'); self::assertEquals( 'FOR u IN users FILTER u.name == @'.$qb->getQueryId().'_1 AND u.age == 27 RETURN u',