Skip to content

Commit 9d29367

Browse files
author
Wout Gevaert
committed
Add possibility of CompositeType in Equals
1 parent 3f3276c commit 9d29367

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Equality.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
namespace WikibaseSolutions\CypherDSL;
2323

2424
use WikibaseSolutions\CypherDSL\Traits\BooleanTypeTrait;
25+
use WikibaseSolutions\CypherDSL\Traits\ErrorTrait;
26+
use WikibaseSolutions\CypherDSL\Types\AnyType;
2527
use WikibaseSolutions\CypherDSL\Types\PropertyTypes\BooleanType;
2628
use WikibaseSolutions\CypherDSL\Types\PropertyTypes\PropertyType;
29+
use WikibaseSolutions\CypherDSL\Types\CompositeTypes\CompositeType;
2730

2831
/**
2932
* Represents the application of the equality (=) operator.
@@ -34,12 +37,16 @@
3437
class Equality extends BinaryOperator implements BooleanType
3538
{
3639
use BooleanTypeTrait;
40+
use ErrorTrait;
3741

3842
/**
3943
* @inheritDoc
4044
*/
41-
public function __construct(PropertyType $left, PropertyType $right, bool $insertParentheses = true)
45+
public function __construct(Anytype $left, AnyType $right, bool $insertParentheses = true)
4246
{
47+
self::assertClass('left', [PropertyType::class, CompositeType::class], $left);
48+
self::assertClass('right', [PropertyType::class, CompositeType::class], $right);
49+
4350
parent::__construct($left, $right, $insertParentheses);
4451
}
4552

src/Exponentiation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use WikibaseSolutions\CypherDSL\Types\PropertyTypes\NumeralType;
2626

2727
/**
28-
* Represents the application of the exponentiation (+) operator.
28+
* Represents the application of the exponentiation (^) operator.
2929
*
3030
* @see https://neo4j.com/docs/cypher-manual/current/syntax/operators/#syntax-using-the-exponentiation-operator
3131
*/

0 commit comments

Comments
 (0)