Skip to content

Commit 8dc255a

Browse files
Fix some type hints
1 parent f98d203 commit 8dc255a

File tree

9 files changed

+24
-22
lines changed

9 files changed

+24
-22
lines changed

src/Clauses/CallProcedureClause.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class CallProcedureClause extends Clause
3333
private ?Procedure $procedure = null;
3434

3535
/**
36-
* @var Alias[]|Variable[] The result fields that are yielded
36+
* @var Alias[]|Variable[]|(Alias|Variable)[] The result fields that are yielded
3737
*/
3838
private array $yields = [];
3939

@@ -84,7 +84,7 @@ public function getProcedure(): ?Procedure
8484
/**
8585
* Returns the variables to yield.
8686
*
87-
* @return Alias[]|Variable[]
87+
* @return Alias[]|Variable[]|(Alias|Variable)[]
8888
*/
8989
public function getYields(): array
9090
{

src/Clauses/RemoveClause.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class RemoveClause extends Clause
2626
use ErrorTrait;
2727

2828
/**
29-
* @var Label[]|Property[] the expressions in this REMOVE clause
29+
* @var Label[]|Property[]|(Label|Property)[] the expressions in this REMOVE clause
3030
*/
3131
private array $expressions = [];
3232

@@ -48,7 +48,7 @@ public function addExpression(...$expressions): self
4848
/**
4949
* Returns the expressions in the REMOVE clause.
5050
*
51-
* @return Label[]|Property[]
51+
* @return Label[]|Property[]|(Label|Property)[]
5252
*/
5353
public function getExpressions(): array
5454
{

src/Clauses/ReturnClause.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class ReturnClause extends Clause
3434
private bool $distinct = false;
3535

3636
/**
37-
* @var Alias[]|AnyType[] The expressions to return
37+
* @var Alias[]|AnyType[]|(Alias|AnyType)[] The expressions to return
3838
*/
3939
private array $columns = [];
4040

@@ -77,7 +77,7 @@ public function setDistinct(bool $distinct = true): self
7777
/**
7878
* Returns the columns to return. Aliased columns have string keys instead of integers.
7979
*
80-
* @return Alias[]|AnyType[]
80+
* @return Alias[]|AnyType[]|(Alias|AnyType)[]
8181
*/
8282
public function getColumns(): array
8383
{

src/Clauses/SetClause.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class SetClause extends Clause
2626
use ErrorTrait;
2727

2828
/**
29-
* @var Label[]|PropertyReplacement[] The expressions to set
29+
* @var Label[]|PropertyReplacement[]|(Label|PropertyReplacement)[] The expressions to set
3030
*/
3131
private array $expressions = [];
3232

@@ -48,7 +48,7 @@ public function add(...$expressions): self
4848
/**
4949
* Returns the expressions to SET.
5050
*
51-
* @return Label[]|PropertyReplacement[]
51+
* @return Label[]|PropertyReplacement[]|(Label|PropertyReplacement)[]
5252
*/
5353
public function getExpressions(): array
5454
{

src/Clauses/WithClause.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class WithClause extends Clause
3131
use CastTrait;
3232

3333
/**
34-
* @var Alias[]|Variable[] The variables to include in the clause
34+
* @var Alias[]|Variable[]|(Alias|Variable)[] The variables to include in the clause
3535
*/
3636
private array $entries = [];
3737

@@ -58,7 +58,7 @@ public function addEntry(...$entries): self
5858
/**
5959
* Returns the expression to include in the clause.
6060
*
61-
* @return Alias[]|Variable[]
61+
* @return Alias[]|Variable[]|(Alias|Variable)[]
6262
*/
6363
public function getEntries(): array
6464
{

src/Expressions/Literals/Map.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010
namespace WikibaseSolutions\CypherDSL\Expressions\Literals;
1111

12+
use WikibaseSolutions\CypherDSL\Traits\CastTrait;
1213
use WikibaseSolutions\CypherDSL\Traits\ErrorTrait;
1314
use WikibaseSolutions\CypherDSL\Traits\EscapeTrait;
1415
use WikibaseSolutions\CypherDSL\Traits\TypeTraits\CompositeTypeTraits\MapTypeTrait;
@@ -26,6 +27,7 @@
2627
*/
2728
final class Map implements MapType
2829
{
30+
use CastTrait;
2931
use EscapeTrait;
3032
use MapTypeTrait;
3133

src/Expressions/Procedures/Procedure.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ abstract class Procedure implements QueryConvertible
3535
* Produces a raw function call. This enables the usage of unimplemented functions in your
3636
* Cypher queries. The parameters of this function are not type-checked.
3737
*
38-
* @param string $functionName The name of the function to call
39-
* @param AnyType|AnyType[]|bool|bool[]|float|float[]|int|int[]|mixed[]|mixed[][]|Pattern|Pattern[]|string|string[] $parameters The parameters to pass to the function call
38+
* @param string $functionName The name of the function to call
39+
* @param AnyType|AnyType[]|bool|bool[]|float|float[]|int|int[]|mixed[]|mixed[][]|Pattern|Pattern[]|string|string[]|(AnyType|bool|float|int|mixed[]|Pattern|string)[] $parameters The parameters to pass to the function call
4040
*/
4141
public static function raw(string $functionName, $parameters): Raw
4242
{

src/Query.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public function __toString(): string
363363
* @note This feature is not part of the openCypher standard.
364364
*
365365
* @param callable|Query $query A callable decorating a Query, or an instance of Query
366-
* @param Pattern|Pattern[]|string|string[]|Variable|Variable[] $variables The variables to include in the WITH clause for correlation (optional)
366+
* @param Pattern|Pattern[]|string|string[]|Variable|Variable[]|(Pattern|string|Variable)[] $variables The variables to include in the WITH clause for correlation (optional)
367367
*
368368
* @return $this
369369
*
@@ -397,7 +397,7 @@ public function call($query, $variables = []): self
397397
* Creates the CALL procedure clause.
398398
*
399399
* @param Procedure $procedure The procedure to call
400-
* @param Alias|Alias[]|string|string[]|Variable|Variable[] $yields The result fields that should be returned (optional)
400+
* @param Alias|Alias[]|string|string[]|Variable|Variable[]|(Alias|string|Variable)[] $yields The result fields that should be returned (optional)
401401
*
402402
* @return $this
403403
*
@@ -446,7 +446,7 @@ public function match($patterns): self
446446
/**
447447
* Creates the RETURN clause.
448448
*
449-
* @param Alias|Alias[]|AnyType|AnyType[]|array|bool|bool[]|float|float[]|int|int[]|Pattern|Pattern[]|string|string[] $expressions A single expression to return, or a non-empty list of expressions to return
449+
* @param Alias|Alias[]|AnyType|AnyType[]|mixed[]|bool|bool[]|float|float[]|int|int[]|Pattern|Pattern[]|string|string[]|(Alias|AnyType|mixed[]|bool|float|int|Pattern|string)[] $expressions A single expression to return, or a non-empty list of expressions to return
450450
* @param bool $distinct Whether to be a RETURN DISTINCT clause (optional, default: false)
451451
*
452452
* @return $this
@@ -496,7 +496,7 @@ public function create($patterns): self
496496
/**
497497
* Creates the DELETE clause.
498498
*
499-
* @param Pattern|Pattern[]|StructuralType|StructuralType[] $structures A single structure to delete, or a non-empty list of structures to delete
499+
* @param Pattern|Pattern[]|StructuralType|StructuralType[]|(Pattern|StructuralType)[] $structures A single structure to delete, or a non-empty list of structures to delete
500500
* @param bool $detach Whether to DETACH DELETE (optional, default: false)
501501
*
502502
* @return $this
@@ -521,7 +521,7 @@ public function delete($structures, bool $detach = false): self
521521
/**
522522
* Creates the DETACH DELETE clause.
523523
*
524-
* @param Pattern|Pattern[]|StructuralType|StructuralType[] $structures A single structure to delete, or a non-empty list of structures to delete
524+
* @param Pattern|Pattern[]|StructuralType|StructuralType[]|(Pattern|StructuralType)[] $structures A single structure to delete, or a non-empty list of structures to delete
525525
*
526526
* @return $this
527527
*
@@ -644,7 +644,7 @@ public function orderBy($properties, bool $descending = false): self
644644
/**
645645
* Creates the REMOVE clause.
646646
*
647-
* @param Label|Label[]|Property|Property[] $expressions A single expression to remove, or a non-empty list of expressions to remove
647+
* @param Label|Label[]|Property|Property[]|(Label|Property)[] $expressions A single expression to remove, or a non-empty list of expressions to remove
648648
*
649649
* @return $this
650650
*
@@ -667,7 +667,7 @@ public function remove($expressions): self
667667
/**
668668
* Create the SET clause.
669669
*
670-
* @param Label|Label[]|PropertyReplacement|PropertyReplacement[] $expressions A single expression to set, or a non-empty list of expressions to set
670+
* @param Label|Label[]|PropertyReplacement|PropertyReplacement[]|(Label|PropertyReplacement)[] $expressions A single expression to set, or a non-empty list of expressions to set
671671
*
672672
* @return $this
673673
*
@@ -690,7 +690,7 @@ public function set($expressions): self
690690
/**
691691
* Creates the WHERE clause.
692692
*
693-
* @param bool|bool[]|BooleanType|BooleanType[] $expressions A boolean expression to evaluate, or a non-empty list of boolean expression to evaluate
693+
* @param bool|bool[]|BooleanType|BooleanType[]|(bool|BooleanType)[] $expressions A boolean expression to evaluate, or a non-empty list of boolean expression to evaluate
694694
* @param string $operator The operator with which to unify the given expressions, should be either WhereClause::OR,
695695
* WhereClause::AND or WhereClause::XOR (optional, default: 'and')
696696
*
@@ -718,7 +718,7 @@ public function where($expressions, string $operator = WhereClause::AND): self
718718
/**
719719
* Creates the WITH clause.
720720
*
721-
* @param Alias|Alias[]|AnyType|AnyType[]|bool|bool[]|float|float[]|int|int[]|mixed[]|mixed[][]|Pattern|Pattern[]|string|string[] $expressions An entry to add, or a non-empty list of entries to add; if the array-key is non-numerical, it is used as the alias
721+
* @param Alias|Alias[]|AnyType|AnyType[]|bool|bool[]|float|float[]|int|int[]|mixed[]|mixed[][]|Pattern|Pattern[]|string|string[]|(Alias|AnyType|bool|float|int|mixed[]|Pattern|string)[] $expressions An entry to add, or a non-empty list of entries to add; if the array-key is non-numerical, it is used as the alias
722722
*
723723
* @return $this
724724
*

src/Traits/TypeTraits/CompositeTypeTraits/MapTypeTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use WikibaseSolutions\CypherDSL\Traits\TypeTraits\MethodTraits\PropertyMethodTrait;
1313

1414
/**
15-
* This trait provides a default implementation to satisfy the "MapType" interface.e.
15+
* This trait provides a default implementation to satisfy the "MapType" interface.
1616
*/
1717
trait MapTypeTrait
1818
{

0 commit comments

Comments
 (0)