Code Duplication    Length = 14-16 lines in 2 locations

lib/Query/Composite.php 1 location

@@ 20-35 (lines=16) @@
17
    private $expressions;
18
    private $type;
19
20
    public function __construct(string $type, array $expressions)
21
    {
22
        // ensure types
23
        array_map(function (Expression $expr) {
24
        }, $expressions);
25
26
        if (!in_array($type, self::$validTypes)) {
27
            throw new \InvalidArgumentException(sprintf(
28
                'Invalid composite type "%s", must be one of "%s"',
29
                $type, implode('", "', self::$validTypes)
30
            ));
31
        }
32
33
        $this->expressions = $expressions;
34
        $this->type = $type;
35
    }
36
37
    public function getExpressions()
38
    {

lib/Query/Comparison.php 1 location

@@ 41-54 (lines=14) @@
38
    private $field;
39
    private $value;
40
41
    public function __construct(string $comparator, $field, $value)
42
    {
43
        if (!in_array($comparator, self::$validTypes)) {
44
            throw new \InvalidArgumentException(sprintf(
45
                'Unknown comparator "%s". Known comparators: "%s"',
46
                $comparator,
47
                implode('", "', self::$validTypes)
48
            ));
49
        }
50
51
        $this->comparator = $comparator;
52
        $this->field = $field;
53
        $this->value = $value;
54
    }
55
56
    public function getComparator()
57
    {