Code Duplication    Length = 9-12 lines in 2 locations

src/Xtools/UserRepository.php 2 locations

@@ 100-108 (lines=9) @@
97
     * @param string $username The username to find.
98
     * @return int|null As returned by the database.
99
     */
100
    public function getEditCount($databaseName, $username)
101
    {
102
        $userTable = $this->getTableName($databaseName, 'user');
103
        $sql = "SELECT user_editcount FROM $userTable WHERE user_name = :username LIMIT 1";
104
        $resultQuery = $this->getProjectsConnection()->prepare($sql);
105
        $resultQuery->bindParam('username', $username);
106
        $resultQuery->execute();
107
        return $resultQuery->fetchColumn();
108
    }
109
110
    /**
111
     * Get group names of the given user.
@@ 188-199 (lines=12) @@
185
     * @param $userid The ID of the user to search for.
186
     * @return bool|string Expiry of active block or false
187
     */
188
    public function getBlockExpiry($databaseName, $userid)
189
    {
190
        $ipblocksTable = $this->getTableName($databaseName, 'ipblocks');
191
        $sql = "SELECT ipb_expiry
192
                FROM $ipblocksTable
193
                WHERE ipb_user = :userid
194
                LIMIT 1";
195
        $resultQuery = $this->getProjectsConnection()->prepare($sql);
196
        $resultQuery->bindParam('userid', $userid);
197
        $resultQuery->execute();
198
        return $resultQuery->fetchColumn();
199
    }
200
201
    /**
202
     * Get pages created by a user