Code Duplication    Length = 10-12 lines in 2 locations

app/code/community/Nexcessnet/Turpentine/Model/Varnish/Admin.php 2 locations

@@ 44-55 (lines=12) @@
41
     */
42
    public function flushUrl($subPattern) {
43
        $result = array();
44
        foreach (Mage::helper('turpentine/varnish')->getSockets() as $socket) {
45
            $socketName = $socket->getConnectionString();
46
            try {
47
                // We don't use "ban_url" here, because we want to do lurker friendly bans.
48
                // Lurker friendly bans get cleaned up, so they don't slow down Varnish.
49
                $socket->ban('obj.http.X-Varnish-URL', '~', $subPattern);
50
            } catch (Mage_Core_Exception $e) {
51
                $result[$socketName] = $e->getMessage();
52
                continue;
53
            }
54
            $result[$socketName] = true;
55
        }
56
        return $result;
57
    }
58
@@ 68-77 (lines=10) @@
65
    public function flushExpression() {
66
        $args = func_get_args();
67
        $result = array();
68
        foreach (Mage::helper('turpentine/varnish')->getSockets() as $socket) {
69
            $socketName = $socket->getConnectionString();
70
            try {
71
                call_user_func_array(array($socket, 'ban'), $args);
72
            } catch (Mage_Core_Exception $e) {
73
                $result[$socketName] = $e->getMessage();
74
                continue;
75
            }
76
            $result[$socketName] = true;
77
        }
78
        return $result;
79
    }
80