Code Duplication    Length = 14-15 lines in 2 locations

src/Filter/Comparison.php 1 location

@@ 69-83 (lines=15) @@
66
     *
67
     * @throws InvalidArgumentException
68
     */
69
    public function __construct($operator, $field, $value, $dqlAlias = null)
70
    {
71
        if (!in_array($operator, self::$operators)) {
72
            throw new InvalidArgumentException(sprintf(
73
                '"%s" is not a valid comparison operator. Valid operators are: "%s"',
74
                $operator,
75
                implode(', ', self::$operators)
76
            ));
77
        }
78
79
        $this->operator = $operator;
80
        $this->field = $field;
81
        $this->value = $value;
82
        $this->dqlAlias = $dqlAlias;
83
    }
84
85
    /**
86
     * @param QueryBuilder $qb

src/Operand/Arithmetic.php 1 location

@@ 51-64 (lines=14) @@
48
     * @param Operand|string $field
49
     * @param Operand|string $value
50
     */
51
    public function __construct($operation, $field, $value)
52
    {
53
        if (!in_array($operation, self::$operations)) {
54
            throw new InvalidArgumentException(sprintf(
55
                '"%s" is not a valid arithmetic operation. Valid operations are: "%s"',
56
                $operation,
57
                implode(', ', self::$operations)
58
            ));
59
        }
60
61
        $this->operation = $operation;
62
        $this->field = $field;
63
        $this->value = $value;
64
    }
65
66
    /**
67
     * @param QueryBuilder $qb