Completed
Push — master ( a6fe0f...b0c0c1 )
by Sebastian
02:05
created

Header::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
namespace DjThossi\SmokeTestingPhp\ValueObject;
3
4
class Header
5
{
6
    /**
7
     * @var HeaderKey
8
     */
9
    private $key;
10
11
    /**
12
     * @var HeaderValue
13
     */
14
    private $value;
15
16
    /**
17
     * @param HeaderKey $key
18
     * @param HeaderValue $value
19
     */
20
    public function __construct(HeaderKey $key, HeaderValue $value)
21
    {
22
        $this->key = $key;
23
        $this->value = $value;
24
    }
25
26
    /**
27
     * @param string $key
28
     * @param string $value
29
     *
30
     * @return Header
31
     */
32
    public static function fromPrimitives($key, $value)
33
    {
34
        return new self(
35
            new HeaderKey($key),
36
            new HeaderValue($value)
37
        );
38
    }
39
40
    /**
41
     * @return HeaderKey
42
     */
43
    public function getKey()
44
    {
45
        return $this->key;
46
    }
47
48
    /**
49
     * @return HeaderValue
50
     */
51
    public function getValue()
52
    {
53
        return $this->value;
54
    }
55
}
56