InteractionRequestDTO::getDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace SmartGamma\Behat\PactExtension\Infrastructure\Interaction;
4
5
class InteractionRequestDTO
6
{
7
    /**
8
     * @var string
9
     */
10
    private $providerName;
11
12
    /**
13
     * @var string
14
     */
15
    private $description;
16
17
    /**
18
     * @var string
19
     */
20
    private $method;
21
22
    /**
23
     * @var string
24
     */
25
    private $uri;
26
27
    /**
28
     * @var string | null
29
     */
30
    private $query;
31
32
    /**
33
     * @var array
34
     */
35
    private $body;
36
37
    /**
38
     * @var array
39
     */
40
    private $headers = [];
41
42
    /**
43
     * InteractionRequestDTO constructor.
44
     *
45
     * @param string      $providerName
46
     * @param string      $description
47
     * @param string      $uri
48
     * @param string      $method
49
     * @param array       $headers
50
     * @param string|null $query
51
     * @param array       $body
52
     */
53 8
    public function __construct(
54
        string $providerName,
55
        string $description,
56
        string $uri,
57
        string $method = 'GET',
58
        array $headers = [],
59
        ?string $query = null,
60
        array $body = []
61
    )
62
    {
63 8
        $this->providerName = $providerName;
64 8
        $this->description  = $description;
65 8
        $this->uri          = $uri;
66 8
        $this->method       = $method;
67 8
        $this->query        = $query;
68 8
        $this->body         = $body;
69 8
        $this->headers      = $headers;
70
    }
71
72
    /**
73
     * @return string
74
     */
75 1
    public function getProviderName(): string
76
    {
77 1
        return $this->providerName;
78
    }
79
80
    /**
81
     * @return string
82
     */
83 1
    public function getDescription(): string
84
    {
85 1
        return $this->description;
86
    }
87
88
    /**
89
     * @return string
90
     */
91
    public function getUri(): string
92
    {
93
        return $this->uri;
94
    }
95
96
    /**
97
     * @return string
98
     */
99
    public function getMethod(): string
100
    {
101
        return $this->method;
102
    }
103
104
    /**
105
     * @return string|null
106
     */
107
    public function getQuery(): ?string
108
    {
109
        return $this->query;
110
    }
111
112
    /**
113
     * @return array
114
     */
115
    public function getBody(): array
116
    {
117
        return $this->body;
118
    }
119
120
    /**
121
     * @return array
122
     */
123
    public function getHeaders(): array
124
    {
125
        return $this->headers;
126
    }
127
}
128