Code Duplication    Length = 18-18 lines in 2 locations

src/Cart.php 1 location

@@ 30-47 (lines=18) @@
27
     * @param string $cart
28
     * @param string $cust
29
     */
30
    private function processFindCarts($cart, $cust)
31
    {
32
        $sql = 'SELECT DISTINCT pc.id_cart as id, DATE_FORMAT(pc.date_upd,"%a %D %b %Y, %l:%i %p") as timer from '._DB_PREFIX_.'cart as pc
33
                LEFT JOIN  '._DB_PREFIX_.'cart_product as pcp on pcp.id_cart = pc.id_cart
34
                WHERE pc.id_cart NOT IN (SELECT po.id_cart FROM  '._DB_PREFIX_.'orders as po)
35
                AND pcp.id_product IS NOT NULL
36
                AND pc.id_customer = '.(int) $cust.'
37
                AND pc.id_cart != '.(int) $cart.'
38
                ORDER BY pc.date_upd DESC
39
                LIMIT 10';
40
        if ($results = $this->dbConn->fetchRowMany($sql)) {
41
            foreach ($results as &$row) {
42
                $row['token'] = md5(_COOKIE_KEY_.'recover_cart_'.$row['id']);
43
            }
44
45
            return $results;
46
        }
47
    }
48
49
}

src/Prestashop.php 1 location

@@ 117-134 (lines=18) @@
114
     * @param string $cart
115
     * @param string $cust
116
     */
117
    private function processFindCarts($cart, $cust)
118
    {
119
        $sql = 'SELECT DISTINCT pc.id_cart as id, DATE_FORMAT(pc.date_upd,"%a %D %b %Y, %l:%i %p") as timer from '._DB_PREFIX_.'cart as pc
120
                LEFT JOIN  '._DB_PREFIX_.'cart_product as pcp on pcp.id_cart = pc.id_cart
121
                WHERE pc.id_cart NOT IN (SELECT po.id_cart FROM  '._DB_PREFIX_.'orders as po)
122
                AND pcp.id_product IS NOT NULL
123
                AND pc.id_customer = '.(int) $cust.'
124
                AND pc.id_cart != '.(int) $cart.'
125
                ORDER BY pc.date_upd DESC
126
                LIMIT 10';
127
        if ($results = $this->dbConn->fetchRowMany($sql)) {
128
            foreach ($results as &$row) {
129
                $row['token'] = md5(_COOKIE_KEY_.'recover_cart_'.$row['id']);
130
            }
131
132
            return $results;
133
        }
134
    }
135
136
    /**
137
     * @param string $product