Total Complexity | 5 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | class Query extends AbstractPart |
||
14 | { |
||
15 | /** @var string|null The original query string. */ |
||
16 | private $query; |
||
17 | |||
18 | 45 | public function __construct(?string $query = null) |
|
21 | 45 | } |
|
22 | |||
23 | 32 | public function getQuery() : string |
|
24 | { |
||
25 | 32 | $this->initialize(); |
|
26 | |||
27 | 32 | return http_build_query($this->data); |
|
28 | } |
||
29 | |||
30 | 1 | public function setQuery(string $query) : void |
|
31 | { |
||
32 | 1 | $this->initialized = false; |
|
33 | 1 | $this->query = $query; |
|
34 | 1 | } |
|
35 | |||
36 | 29 | public function __toString() : string |
|
37 | { |
||
38 | 29 | return $this->getQuery(); |
|
39 | } |
||
40 | |||
41 | 32 | protected function doInitialize() : void |
|
46 | 32 | } |
|
47 | } |
||
48 |