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 = 18-18 lines in 2 locations

src/Operator.php 1 location

@@ 393-410 (lines=18) @@
390
     * @return array
391
     * @throws \Sokil\Mongo\Exception
392
     */
393
    public static function convertToArray($mixed)
394
    {
395
        // get operator from callable
396
        if(is_callable($mixed)) {
397
            $callable = $mixed;
398
            $mixed = new self();
399
            call_user_func($callable, $mixed);
400
        }
401
402
        // get operator array
403
        if($mixed instanceof Arrayable && $mixed instanceof self) {
404
            $mixed = $mixed->toArray();
405
        } elseif(!is_array($mixed)) {
406
            throw new Exception('Mixed must be instance of Operator');
407
        }
408
409
        return $mixed;
410
    }
411
}
412

src/Expression.php 1 location

@@ 678-695 (lines=18) @@
675
     * @return array
676
     * @throws \Sokil\Mongo\Exception
677
     */
678
    public static function convertToArray($mixed)
679
    {
680
        // get expression from callable
681
        if(is_callable($mixed)) {
682
            $callable = $mixed;
683
            $mixed = new self();
684
            call_user_func($callable, $mixed);
685
        }
686
687
        // get expression array
688
        if($mixed instanceof Arrayable && $mixed instanceof self) {
689
            $mixed = $mixed->toArray();
690
        } elseif(!is_array($mixed)) {
691
            throw new Exception('Mixed must be instance of Expression');
692
        }
693
694
        return $mixed;
695
    }
696
}
697