Code Duplication    Length = 9-12 lines in 2 locations

src/Xtools/UserRepository.php 2 locations

@@ 90-98 (lines=9) @@
87
     * @param string $username The username to find.
88
     * @return int|null As returned by the database.
89
     */
90
    public function getEditCount($databaseName, $username)
91
    {
92
        $userTable = $this->getTableName($databaseName, 'user');
93
        $sql = "SELECT user_editcount FROM $userTable WHERE user_name = :username LIMIT 1";
94
        $resultQuery = $this->getProjectsConnection()->prepare($sql);
95
        $resultQuery->bindParam('username', $username);
96
        $resultQuery->execute();
97
        return $resultQuery->fetchColumn();
98
    }
99
100
    /**
101
     * Get group names of the given user.
@@ 175-186 (lines=12) @@
172
     * @param $userid The ID of the user to search for.
173
     * @return bool|string Expiry of active block or false
174
     */
175
    public function getBlockExpiry($databaseName, $userid)
176
    {
177
        $ipblocksTable = $this->getTableName($databaseName, 'ipblocks');
178
        $sql = "SELECT ipb_expiry
179
                FROM $ipblocksTable
180
                WHERE ipb_user = :userid
181
                LIMIT 1";
182
        $resultQuery = $this->getProjectsConnection()->prepare($sql);
183
        $resultQuery->bindParam('userid', $userid);
184
        $resultQuery->execute();
185
        return $resultQuery->fetchColumn();
186
    }
187
188
    /**
189
     * Count the number of pages created by a user.