Passed
Push — master ( c65e58...1194b0 )
by Oss
02:24
created

HeadList   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
dl 0
loc 25
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isHeaderHTTP() 0 3 1
A isHeaderSetCookie() 0 3 1
1
<?php
2
/**
3
 * @category    Brownie/HttpClient
4
 * @author      Brownie <[email protected]>
5
 * @license     http://www.gnu.org/copyleft/lesser.html
6
 */
7
8
namespace Brownie\HttpClient;
9
10
use Brownie\Util\StorageList;
11
12
/**
13
 * A wrapper for common lists of HTTP Headers.
14
 */
15
class HeadList extends StorageList
16
{
17
18
    /**
19
     * Returns the SetCookie flag of the HTTP header.
20
     *
21
     * @param string    $headerLine     HTTP header line.
22
     *
23
     * @return bool
24
     */
25 5
    protected function isHeaderSetCookie($headerLine)
26
    {
27 5
        return ('Set-Cookie:' == substr($headerLine, 0, 11));
28
    }
29
30
    /**
31
     * Returns the HTTP flag of the header.
32
     *
33
     * @param string    $headerLine     HTTP header line.
34
     *
35
     * @return bool
36
     */
37 3
    protected function isHeaderHTTP($headerLine)
38
    {
39 3
        return ('HTTP/' == substr($headerLine, 0, 5));
40
    }
41
}
42