Code Duplication    Length = 9-12 lines in 2 locations

src/Xtools/UserRepository.php 2 locations

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