-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathComparisonBinaryOperator.php
More file actions
61 lines (55 loc) · 1.77 KB
/
Copy pathComparisonBinaryOperator.php
File metadata and controls
61 lines (55 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php declare(strict_types=1);
/*
* This file is part of php-cypher-dsl.
*
* Copyright (C) Wikibase Solutions
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace WikibaseSolutions\CypherDSL\Expressions\Operators;
use WikibaseSolutions\CypherDSL\Traits\TypeTraits\PropertyTypeTraits\BooleanTypeTrait;
use WikibaseSolutions\CypherDSL\Types\AnyType;
use WikibaseSolutions\CypherDSL\Types\PropertyTypes\BooleanType;
/**
* Represents a comparison binary operator. These are:.
*
* - equality: "="
* - inequality: "<>"
* - less than: "<"
* - greater than: ">"
* - less than or equal to: "<="
* - greater than or equal to: ">="
*
* In additional, there are some string-specific comparison operators:
*
* - case-sensitive prefix search on strings: "STARTS WITH"
* - case-sensitive suffix search on strings: "ENDS WITH"
* - case-sensitive inclusion search in strings: "CONTAINS"
*
* @see https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-comparison Corresponding documentation on Neo4j.com
*/
abstract class ComparisonBinaryOperator extends BinaryOperator implements BooleanType
{
use BooleanTypeTrait;
/**
* @inheritDoc
*
* @param AnyType $left The left-hand of the comparison operator
* @param AnyType $right The right-hand of the comparison operator
*/
public function __construct(AnyType $left, AnyType $right)
{
parent::__construct($left, $right);
}
/**
* @inheritDoc
*/
protected function shouldInsertParentheses(AnyType $expression): bool
{
if ($expression instanceof self) {
return false;
}
return parent::shouldInsertParentheses($expression);
}
}