Code Duplication    Length = 16-16 lines in 2 locations

src/Brownie/HttpClient/Cookie/CookieList.php 1 location

@@ 18-33 (lines=16) @@
15
    /**
16
     * Initializing the cookies container.
17
     */
18
    protected function initList()
19
    {
20
        $cookieList = array();
21
        foreach (explode("\r\n", trim($this->getInitData())) as $headerLine) {
22
            if (empty($headerLine)) {
23
                $cookieList = array();
24
                continue;
25
            }
26
            if (!$this->isHeaderSetCookie($headerLine)) {
27
                continue;
28
            }
29
            $cookieParams = $this->getCookieParams($headerLine);
30
            $cookieList[$cookieParams['name']] = new Cookie($cookieParams);
31
        }
32
        $this->setList($cookieList);
33
    }
34
35
    /**
36
     * Splits HTTP header on the parameters.

src/Brownie/HttpClient/Header/HeaderList.php 1 location

@@ 21-36 (lines=16) @@
18
    /**
19
     * Initializing the headers container.
20
     */
21
    protected function initList()
22
    {
23
        $headerList = array();
24
        foreach (explode("\r\n", trim($this->getInitData())) as $headerLine) {
25
            if (empty($headerLine)) {
26
                $headerList = array();
27
                continue;
28
            }
29
            if ($this->isHeaderHTTP($headerLine) || $this->isHeaderSetCookie($headerLine)) {
30
                continue;
31
            }
32
            $headerParams = $this->getHeaderParams($headerLine);
33
            $headerList[strtolower($headerParams['name'])] = new Header($headerParams);
34
        }
35
        $this->setList($headerList);
36
    }
37
38
    /**
39
     * Splits Cookie HTTP header on the parameters.