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.
@@ 184-195 (lines=12) @@
181
     * @param $userid The ID of the user to search for.
182
     * @return bool|string Expiry of active block or false
183
     */
184
    public function getBlockExpiry($databaseName, $userid)
185
    {
186
        $ipblocksTable = $this->getTableName($databaseName, 'ipblocks');
187
        $sql = "SELECT ipb_expiry
188
                FROM $ipblocksTable
189
                WHERE ipb_user = :userid
190
                LIMIT 1";
191
        $resultQuery = $this->getProjectsConnection()->prepare($sql);
192
        $resultQuery->bindParam('userid', $userid);
193
        $resultQuery->execute();
194
        return $resultQuery->fetchColumn();
195
    }
196
197
    /**
198
     * Get pages created by a user