5454use WikibaseSolutions \CypherDSL \Types \PropertyTypes \StringType ;
5555use WikibaseSolutions \CypherDSL \Types \StructuralTypes \NodeType ;
5656use WikibaseSolutions \CypherDSL \Types \StructuralTypes \PathType ;
57- use WikibaseSolutions \CypherDSL \Types \StructuralTypes \StructuralType ;
5857
5958/**
6059 * Builder class for building complex Cypher queries.
@@ -217,7 +216,7 @@ public static function rawExpression(string $expression): AnyType
217216 /**
218217 * Creates the MATCH clause.
219218 *
220- * @param StructuralType|StructuralType [] $patterns A single pattern or a list of patterns
219+ * @param PathType|NodeType|(PathType|NodeType) [] $patterns A single pattern or a list of patterns
221220 *
222221 * @return $this
223222 * @see https://neo4j.com/docs/cypher-manual/current/clauses/match/
@@ -232,7 +231,7 @@ public function match($patterns): self
232231 }
233232
234233 foreach ($ patterns as $ pattern ) {
235- $ this ->assertClass ('pattern ' , StructuralType ::class, $ pattern );
234+ $ this ->assertClass ('pattern ' , [PathType ::class, NodeType::class] , $ pattern );
236235
237236 $ matchClause ->addPattern ($ pattern );
238237 }
@@ -283,7 +282,7 @@ public function returning($expressions, bool $distinct = false): self
283282 /**
284283 * Creates the CREATE clause.
285284 *
286- * @param StructuralType|StructuralType [] $patterns A single pattern or a list of patterns
285+ * @param PathType|NodeType|(PathType|NodeType) [] $patterns A single pattern or a list of patterns
287286 *
288287 * @return $this
289288 * @see https://neo4j.com/docs/cypher-manual/current/clauses/create/
@@ -298,7 +297,7 @@ public function create($patterns): self
298297 }
299298
300299 foreach ($ patterns as $ pattern ) {
301- $ this ->assertClass ('pattern ' , StructuralType ::class, $ pattern );
300+ $ this ->assertClass ('pattern ' , [PathType ::class, NodeType::class] , $ pattern );
302301
303302 $ createClause ->addPattern ($ pattern );
304303 }
@@ -405,16 +404,17 @@ public function skip(NumeralType $limit): self
405404 /**
406405 * Creates the MERGE clause.
407406 *
408- * @param StructuralType $pattern The pattern to merge
407+ * @param PathType|NodeType $pattern The pattern to merge
409408 * @param Clause|null $createClause The clause to execute when the pattern is created
410409 * @param Clause|null $matchClause The clause to execute when the pattern is matched
411410 *
412411 * @return $this
413412 * @see https://neo4j.com/docs/cypher-manual/current/clauses/merge/
414413 *
415414 */
416- public function merge (StructuralType $ pattern , Clause $ createClause = null , Clause $ matchClause = null ): self
415+ public function merge ($ pattern , Clause $ createClause = null , Clause $ matchClause = null ): self
417416 {
417+ $ this ->assertClass ('pattern ' , [PathType::class, NodeType::class], $ pattern );
418418 $ mergeClause = new MergeClause ();
419419 $ mergeClause ->setPattern ($ pattern );
420420
@@ -434,7 +434,7 @@ public function merge(StructuralType $pattern, Clause $createClause = null, Clau
434434 /**
435435 * Creates the OPTIONAL MATCH clause.
436436 *
437- * @param StructuralType|StructuralType [] $patterns A single pattern or a list of patterns
437+ * @param PathType|NodeType|(PathType|NodeType) [] $patterns A single pattern or a list of patterns
438438 *
439439 * @return $this
440440 * @see https://neo4j.com/docs/cypher-manual/current/clauses/optional-match/
@@ -449,7 +449,7 @@ public function optionalMatch($patterns): self
449449 }
450450
451451 foreach ($ patterns as $ pattern ) {
452- $ this ->assertClass ('pattern ' , StructuralType ::class, $ pattern );
452+ $ this ->assertClass ('pattern ' , [PathType ::class, NodeType::class] , $ pattern );
453453
454454 $ optionalMatchClause ->addPattern ($ pattern );
455455 }
0 commit comments