Completed
Pull Request — develop (#2)
by Sebastian
02:16
created

ErrorResult::getHeaders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace DjThossi\SmokeTestingPhp\Result;
3
4
use DjThossi\SmokeTestingPhp\Collection\HeaderCollection;
5
use DjThossi\SmokeTestingPhp\ValueObject\ErrorMessage;
6
use DjThossi\SmokeTestingPhp\ValueObject\Url;
7
8
class ErrorResult implements Result
9
{
10
    /**
11
     * @var Url
12
     */
13
    private $url;
14
15
    /**
16
     * @var HeaderCollection
17
     */
18
    private $headers;
19
20
    /**
21
     * @var ErrorMessage
22
     */
23
    private $errorMessage;
24
25
    /**
26
     * @param Url $url
27
     * @param HeaderCollection $headers
28
     * @param ErrorMessage $errorMessage
29
     */
30
    public function __construct(Url $url, HeaderCollection $headers, ErrorMessage $errorMessage)
31
    {
32
        $this->url = $url;
33
        $this->headers = $headers;
34
        $this->errorMessage = $errorMessage;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function asString()
41
    {
42
        return $this->errorMessage->asString();
43
    }
44
45
    /**
46
     * @return HeaderCollection
47
     */
48
    public function getHeaders()
49
    {
50
        return $this->headers;
51
    }
52
53
    /**
54
     * @return Url
55
     */
56
    public function getUrl()
57
    {
58
        return $this->url;
59
    }
60
61
    /**
62
     * @return bool
63
     */
64
    public function isValidResult()
65
    {
66
        return false;
67
    }
68
69
    public function getTimeToFirstByte()
70
    {
71
        throw new NotImplementedException('getTimeToFirstByte is not implemented');
72
    }
73
74
    public function getBody()
75
    {
76
        throw new NotImplementedException('getBody is not implemented');
77
    }
78
79
    public function getStatusCode()
80
    {
81
        throw new NotImplementedException('getStatusCode is not implemented');
82
    }
83
}
84