Code Duplication    Length = 10-13 lines in 3 locations

lib/Doctrine/ODM/MongoDB/Query/Expr.php 3 locations

@@ 155-164 (lines=10) @@
152
     * @param mixed|Expr $valueOrExpression
153
     * @return $this
154
     */
155
    public function addToSet($valueOrExpression)
156
    {
157
        if ($valueOrExpression instanceof Expr) {
158
            $valueOrExpression = $valueOrExpression->getQuery();
159
        }
160
161
        $this->requiresCurrentField();
162
        $this->newObj['$addToSet'][$this->currentField] = $valueOrExpression;
163
        return $this;
164
    }
165
166
    /**
167
     * Specify $all criteria for the current field.
@@ 998-1007 (lines=10) @@
995
     * @param mixed|Expr $valueOrExpression
996
     * @return $this
997
     */
998
    public function pull($valueOrExpression)
999
    {
1000
        if ($valueOrExpression instanceof Expr) {
1001
            $valueOrExpression = $valueOrExpression->getQuery();
1002
        }
1003
1004
        $this->requiresCurrentField();
1005
        $this->newObj['$pull'][$this->currentField] = $valueOrExpression;
1006
        return $this;
1007
    }
1008
1009
    /**
1010
     * Remove all elements matching any of the given values from the current
@@ 1044-1056 (lines=13) @@
1041
     * @param mixed|Expr $valueOrExpression
1042
     * @return $this
1043
     */
1044
    public function push($valueOrExpression)
1045
    {
1046
        if ($valueOrExpression instanceof Expr) {
1047
            $valueOrExpression = array_merge(
1048
                ['$each' => []],
1049
                $valueOrExpression->getQuery()
1050
            );
1051
        }
1052
1053
        $this->requiresCurrentField();
1054
        $this->newObj['$push'][$this->currentField] = $valueOrExpression;
1055
        return $this;
1056
    }
1057
1058
    /**
1059
     * Specify $gte and $lt criteria for the current field.