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

phpmyfaq/inc/PMF/User.php 2 locations

@@ 318-352 (lines=35) @@
315
     * @param  bool   $raiseError Raise error?
316
     * @return bool
317
     */
318
    public function getUserByLogin($login, $raiseError = true)
319
    {
320
        $select = sprintf("
321
            SELECT
322
                user_id,
323
                login,
324
                account_status
325
            FROM
326
                %sfaquser
327
            WHERE
328
                login = '%s'",
329
            PMF_Db::getTablePrefix(),
330
            $this->config->getDb()->escape($login)
331
        );
332
        
333
        $res = $this->config->getDb()->query($select);
334
        if ($this->config->getDb()->numRows($res) !== 1) {
335
            if ($raiseError) {
336
337
                $this->errors[] = self::ERROR_USER_INCORRECT_LOGIN;
338
            }
339
            return false;
340
        }
341
        $user = $this->config->getDb()->fetchArray($res);
342
        $this->userId  = (int)    $user['user_id'];
343
        $this->login   = (string) $user['login'];
344
        $this->status  = (string) $user['account_status'];
345
346
        // get user-data
347
        if (!$this->userdata instanceof PMF_User_UserData) {
348
            $this->userdata = new PMF_User_UserData($this->config);
349
        }
350
        $this->userdata->load($this->getUserId());
351
        return true;
352
    }
353
354
    /**
355
     * loads basic user information from the database selecting the user with
@@ 362-399 (lines=38) @@
359
     *
360
     * @return boolean
361
     */
362
    public function getUserByCookie($cookie)
363
    {
364
        $select = sprintf("
365
            SELECT
366
                user_id,
367
                login,
368
                account_status
369
            FROM
370
                %sfaquser
371
            WHERE
372
                remember_me = '%s'",
373
            PMF_Db::getTablePrefix(),
374
            $this->config->getDb()->escape($cookie)
375
        );
376
377
        $res = $this->config->getDb()->query($select);
378
        if ($this->config->getDb()->numRows($res) !== 1) {
379
            $this->errors[] = self::ERROR_USER_INCORRECT_LOGIN;
380
            return false;
381
        }
382
        $user = $this->config->getDb()->fetchArray($res);
383
384
        // Don't ever login via anonymous user
385
        if (-1 === $user['user_id']) {
386
            return false;
387
        }
388
389
        $this->userId = (int)     $user['user_id'];
390
        $this->login   = (string) $user['login'];
391
        $this->status  = (string) $user['account_status'];
392
393
        // get user-data
394
        if (!$this->userdata instanceof PMF_User_UserData) {
395
            $this->userdata = new PMF_User_UserData($this->config);
396
        }
397
        $this->userdata->load($this->getUserId());
398
        return true;
399
    }
400
401
    /**
402
     * search users by login