GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 14-14 lines in 2 locations

src/Expression.php 1 location

@@ 259-272 (lines=14) @@
256
     * @param \Sokil\Mongo\Expression|callable|array $expression
257
     * @return \Sokil\Mongo\Expression
258
     */
259
    public function whereElemMatch($field, $expression)
260
    {
261
        if(is_callable($expression)) {
262
            $expression = call_user_func($expression, $this->expression());
263
        }
264
265
        if($expression instanceof Expression) {
266
            $expression = $expression->toArray();
267
        } elseif(!is_array($expression)) {
268
            throw new Exception('Wrong expression passed');
269
        }
270
271
        return $this->where($field, array('$elemMatch' => $expression));
272
    }
273
274
    /**
275
     * Matches documents in a collection that contain an array field with elements

src/Pipeline.php 1 location

@@ 55-68 (lines=14) @@
52
     * @return \Sokil\Mongo\Pipeline
53
     * @throws \Sokil\Mongo\Exception
54
     */
55
    public function match($expression)
56
    {
57
        if (is_callable($expression)) {
58
            $expressionConfigurator = $expression;
59
            $expression = new Expression();
60
            call_user_func($expressionConfigurator, $expression);
61
            $expression = $expression->toArray();
62
        } elseif (!is_array($expression)) {
63
            throw new Exception('Must be array or instance of Expression');
64
        }
65
66
        $this->addStage('$match', $expression);
67
        return $this;
68
    }
69
70
    /**
71
     * Passes along the documents with only the specified fields to the next