Code Duplication    Length = 11-12 lines in 2 locations

htdocs/xoops_lib/Xoops/Core/Session/Handler.php 2 locations

@@ 158-168 (lines=11) @@
155
     *
156
     * @return bool
157
     */
158
    public function destroy($session_id)
159
    {
160
        $qb = $this->db->createXoopsQueryBuilder();
161
        $eb = $qb->expr();
162
        $qb ->deletePrefix($this->sessionTable)
163
            ->where($eb->eq('session_id', ':sessid'))
164
            ->setParameter(':sessid', $session_id, \PDO::PARAM_STR);
165
        $this->db->setForce(true);
166
        $result = $qb->execute();
167
        return (boolean) ($result>0);
168
    }
169
170
    /**
171
     * Garbage Collector
@@ 177-188 (lines=12) @@
174
     *
175
     * @return bool
176
     */
177
    public function gc($maxlifetime)
178
    {
179
        $mintime = time();
180
        $qb = $this->db->createXoopsQueryBuilder();
181
        $eb = $qb->expr();
182
        $qb ->deletePrefix($this->sessionTable)
183
            ->where($eb->lt('expires_at', ':expires'))
184
            ->setParameter(':expires', $mintime, \PDO::PARAM_INT);
185
        $this->db->setForce(true);
186
        $result = $qb->execute();
187
        return (boolean) ($result>0);
188
    }
189
}
190