ParsedURL::getQueryString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace LunixREST\RequestFactory\URLParser;
3
4
/**
5
 * An immutable data class representing all of the information pulled from a URL when building an APIRequest.
6
 * Class ParsedURL
7
 * @package LunixREST\RequestFactory\URLParser
8
 */
9
class ParsedURL
10
{
11
    /**
12
     * @var string
13
     */
14
    private $endpoint;
15
    /**
16
     * @var null|string
17
     */
18
    private $element;
19
    /**
20
     * @var null|string
21
     */
22
    private $version;
23
    /**
24
     * @var null|string
25
     */
26
    private $apiKey;
27
    /**
28
     * @var array
29
     */
30
    private $acceptableMIMETypes;
31
    /**
32
     * @var null|string
33
     */
34
    private $queryString;
35
36
    /**
37
     * ParsedURL constructor.
38
     * @param string $endpoint
39
     * @param null|string $element
40
     * @param null|string $version
41
     * @param null|string $apiKey
42
     * @param array $acceptableMIMETypes
43
     * @param null|string $queryString
44
     */
45 5
    public function __construct(string $endpoint, ?string $element, ?string $version, ?string $apiKey, array $acceptableMIMETypes, ?string $queryString)
46
    {
47 5
        $this->endpoint = $endpoint;
48 5
        $this->element = $element;
49 5
        $this->version = $version;
50 5
        $this->apiKey = $apiKey;
51 5
        $this->acceptableMIMETypes = $acceptableMIMETypes;
52 5
        $this->queryString = $queryString;
53 5
    }
54
55
    /**
56
     * @return string
57
     */
58 4
    public function getEndpoint(): string
59
    {
60 4
        return $this->endpoint;
61
    }
62
63
    /**
64
     * @return null|string
65
     */
66 1
    public function getElement(): ?string
67
    {
68 1
        return $this->element;
69
    }
70
71
    /**
72
     * @return null|string
73
     */
74 3
    public function getVersion(): ?string
75
    {
76 3
        return $this->version;
77
    }
78
79
    /**
80
     * @return null|string
81
     */
82 2
    public function getApiKey(): ?string
83
    {
84 2
        return $this->apiKey;
85
    }
86
87
    /**
88
     * @return array
89
     */
90 2
    public function getAcceptableMIMETypes(): array
91
    {
92 2
        return $this->acceptableMIMETypes;
93
    }
94
95
    /**
96
     * @return null|string
97
     */
98 1
    public function getQueryString()
99
    {
100 1
        return $this->queryString;
101
    }
102
}
103