TransportRequestException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 7
1
<?php
2
/**
3
 * @author Dmitry Gladyshev <[email protected]>
4
 * @date 17/08/2016 13:16
5
 */
6
7
namespace Yandex\Direct\Exception;
8
9
/**
10
 * Class TransportRequestException
11
 * @package Yandex\Direct\Exception
12
 */
13
class TransportRequestException extends RuntimeException
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $requestHeaders;
19
20
    /**
21
     * @var string
22
     */
23
    protected $requestBody;
24
25
    /**
26
     * @var string
27
     */
28
    protected $responseHeaders;
29
30
    /**
31
     * @var string
32
     */
33
    protected $responseBody;
34
35
    /**
36
     * TransportRequestException constructor.
37
     *
38
     * @param string $message
39
     * @param int $code
40
     * @param array $requestHeaders
41
     * @param string $requestBody
42
     * @param array $responseHeaders
43
     * @param string $responseBody
44
     * @param \Exception|null|Exception $previous
45
     */
46
    public function __construct(
47
        $message,
48
        $code,
49
        $requestHeaders = [],
50
        $requestBody = '',
51
        $responseHeaders = [],
52
        $responseBody = '',
53
        \Exception $previous = null
54
    ) {
55
    
56
        $this->requestBody = $requestBody;
57
        $this->requestHeaders = $requestHeaders;
0 ignored issues
show
Documentation Bug introduced by
It seems like $requestHeaders of type array is incompatible with the declared type string of property $requestHeaders.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
58
        $this->responseBody = $responseBody;
59
        $this->responseHeaders = $responseHeaders;
0 ignored issues
show
Documentation Bug introduced by
It seems like $responseHeaders of type array is incompatible with the declared type string of property $responseHeaders.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
60
61
        parent::__construct($message, $code, $previous);
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getRequestHeaders()
68
    {
69
        return $this->requestHeaders;
70
    }
71
72
    /**
73
     * @return string
74
     */
75
    public function getRequestBody()
76
    {
77
        return $this->requestBody;
78
    }
79
80
    /**
81
     * @return string
82
     */
83
    public function getResponseHeaders()
84
    {
85
        return $this->responseHeaders;
86
    }
87
88
    /**
89
     * @return string
90
     */
91
    public function getResponseBody()
92
    {
93
        return $this->responseBody;
94
    }
95
}
96