Code Duplication    Length = 8-9 lines in 3 locations

src/Charcoal/User/AbstractAuthenticator.php 3 locations

@@ 463-471 (lines=9) @@
460
        }
461
462
        $user = $this->createUser();
463
        if (!$user->source()->tableExists()) {
464
            $this->logger->warning(sprintf(
465
                '[Authenticator] Invalid login attempt for user "%s" (%s): The table "%s" does not exist.',
466
                $identifier,
467
                get_class($user),
468
                $user->source()->table()
469
            ));
470
            return null;
471
        }
472
473
        // Load the user by email
474
        $user->loadFrom($user->getAuthIdentifierKey(), $identifier);
@@ 517-524 (lines=8) @@
514
    protected function authenticateBySession()
515
    {
516
        $user = $this->createUser();
517
        if (!$user->source()->tableExists()) {
518
            $this->logger->warning(sprintf(
519
                '[Authenticator] Invalid login attempt by session for a user (%s): The table "%s" does not exist.',
520
                get_class($user),
521
                $user->source()->table()
522
            ));
523
            return null;
524
        }
525
526
        $key = $user::sessionKey();
527
        if (empty($key) || !isset($_SESSION[$key])) {
@@ 580-587 (lines=8) @@
577
        }
578
579
        $user = $this->createUser();
580
        if (!$user->source()->tableExists()) {
581
            $this->logger->warning(sprintf(
582
                '[Authenticator] Invalid login attempt by token for a user (%s): The table "%s" does not exist.',
583
                get_class($user),
584
                $user->source()->table()
585
            ));
586
            return null;
587
        }
588
589
        $user->loadFrom($user->getAuthIdKey(), $userId);
590