Code Duplication    Length = 5-8 lines in 2 locations

src/Xhgui/Storage/File.php 1 location

@@ 134-138 (lines=5) @@
131
                continue;
132
            }
133
134
            if (null !== $filter->getCookie() &&
135
                strpos($meta['SERVER']['HTTP_COOKIE'], $filter->getCookie()) === false
136
            ) {
137
                continue;
138
            }
139
140
            if (null !== $filter->getIp() && $meta['SERVER']['REMOTE_ADDR'] !== $filter->getIp()) {
141
                continue;

src/Xhgui/Storage/Pdo.php 1 location

@@ 64-71 (lines=8) @@
61
        $tmp = array();
62
        while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
63
            $meta = json_decode($row['meta'], true);
64
            if ($filter->getCookie()) {
65
                // because cookie is not parsed and stored in separate structure we need to double check if
66
                // value that we search is in fact in http cookie server field. SQL filter only checks whole
67
                // meta
68
                if (strpos($meta['SERVER']['HTTP_COOKIE'], $filter->getCookie()) === false) {
69
                    continue;
70
                }
71
            }
72
            $tmp[$row['id']] = $row;
73
            $tmp[$row['id']]['profile'] = json_decode($row['profiles'], true);
74
            $tmp[$row['id']]['meta'] = $meta;