Code Duplication    Length = 3-8 lines in 2 locations

src/Xhgui/Storage/File.php 1 location

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

src/Xhgui/Storage/PDO.php 1 location

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