Code Duplication    Length = 16-16 lines in 2 locations

src/Expression.php 2 locations

@@ 26-41 (lines=16) @@
23
     *
24
     * @return $this
25
     */
26
    public function and($expression)
27
    {
28
        $this->prepareOperator('$and');
29
30
        $this->queryPartial['$and'] = array_merge(
31
            $this->queryPartial['$and'],
32
            array_map(
33
                function ($expression) {
34
                    return $expression instanceof Expression ? $expression->getQueryPartial() : $expression;
35
                },
36
                func_get_args()
37
            )
38
        );
39
40
        return $this;
41
    }
42
43
    /**
44
     * @param array|Expression $expression
@@ 48-63 (lines=16) @@
45
     *
46
     * @return $this
47
     */
48
    public function or($expression)
49
    {
50
        $this->prepareOperator('$or');
51
52
        $this->queryPartial['$or'] = array_merge(
53
            $this->queryPartial['$or'],
54
            array_map(
55
                function ($expression) {
56
                    return $expression instanceof Expression ? $expression->getQueryPartial() : $expression;
57
                },
58
                func_get_args()
59
            )
60
        );
61
62
        return $this;
63
    }
64
65
    /**
66
     * @return array