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

src/Storage.php 2 locations

@@ 301-321 (lines=21) @@
298
        return 1 === $stmt->rowCount();
299
    }
300
301
    public function addCertificate($userId, $commonName, $displayName, $validFrom, $validTo)
302
    {
303
        $userId = $this->getId($userId);
304
        $stmt = $this->db->prepare(
305
<<< 'SQL'
306
    INSERT INTO certificates 
307
        (common_name, user_id, display_name, valid_from, valid_to)
308
    VALUES
309
        (:common_name, :user_id, :display_name, :valid_from, :valid_to)
310
SQL
311
        );
312
        $stmt->bindValue(':common_name', $commonName, PDO::PARAM_STR);
313
        $stmt->bindValue(':user_id', $userId, PDO::PARAM_INT);
314
        $stmt->bindValue(':display_name', $displayName, PDO::PARAM_STR);
315
        $stmt->bindValue(':valid_from', $validFrom, PDO::PARAM_INT);
316
        $stmt->bindValue(':valid_to', $validTo, PDO::PARAM_INT);
317
318
        $stmt->execute();
319
        // XXX
320
        return 1 === $stmt->rowCount();
321
    }
322
323
    public function getCertificates($userId)
324
    {
@@ 501-529 (lines=29) @@
498
        return $stmt->fetchAll(PDO::FETCH_ASSOC);
499
    }
500
501
    public function clientConnect($profileId, $commonName, $ip4, $ip6, $connectedAt)
502
    {
503
        // this query is so complex, because we want to store the user_id in the
504
        // log as well, not just the common_name... the user may delete the
505
        // certificate, or the user account may be deleted...
506
        $stmt = $this->db->prepare(
507
<<< 'SQL'
508
    INSERT INTO connection_log 
509
        (
510
            user_id,
511
            profile_id,
512
            common_name,
513
            ip4,
514
            ip6,
515
            connected_at
516
        ) 
517
    VALUES
518
        (
519
            (
520
                SELECT
521
                    u.user_id
522
                FROM 
523
                    users u, certificates c
524
                WHERE
525
                    u.id = c.user_id
526
                AND
527
                    c.common_name = :common_name
528
            ),                
529
            :profile_id, 
530
            :common_name,
531
            :ip4,
532
            :ip6,