Code Duplication    Length = 15-16 lines in 2 locations

src/PdoDelete.php 1 location

@@ 36-50 (lines=15) @@
33
     * @param LoggerInterface  $logger Optional: PSR-3 Logger
34
     * @param string           $table  Optional: Custom table name, default: `auth_logins`
35
     */
36
    public function __construct( \PDO $pdo, LoggerInterface $logger = null, $table = null )
37
    {
38
39
        $this->table  = $table  ?: $this->table;
40
        $this->logger = $logger ?: new NullLogger;
41
42
43
        // ------------------------------------------
44
        // 1. Prepare statement
45
        // ------------------------------------------
46
        $sql = "DELETE FROM {$this->table}
47
        WHERE user_id = :user_id";
48
49
        $this->stmt = $pdo->prepare($sql);
50
    }
51
52
53
    /**

src/PdoValidator.php 1 location

@@ 41-56 (lines=16) @@
38
     * @param LoggerInterface|null $logger   Optional: PSR-3 Logger
39
     * @param string               $table    Optional: Custom table name, default: `auth_logins`
40
     */
41
    public function __construct( \PDO $pdo, Callable $verifier, LoggerInterface $logger = null, $table = null)
42
    {
43
        $this->verifier = $verifier;
44
        $this->logger   = $logger;
45
        $this->table    = $table ?: $this->table;
46
47
        $sql = "SELECT
48
        user_id,
49
        token_hash
50
        FROM {$this->table}
51
        WHERE selector = :selector
52
        AND valid_until >= NOW()
53
        LIMIT 1";
54
55
        $this->stmt = $pdo->prepare( $sql );
56
    }
57
58
59
    /**