Total Complexity | 9 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | class UriParser implements UriParserInterface |
||
11 | { |
||
12 | /** |
||
13 | * {@inheritdoc} |
||
14 | */ |
||
15 | 33 | public function isAbsolute(UriInterface $uri) |
|
16 | { |
||
17 | 33 | return Uri::isAbsolute($uri); |
|
18 | } |
||
19 | |||
20 | /** |
||
21 | * {@inheritdoc} |
||
22 | */ |
||
23 | 14 | public function isMissingScheme(UriInterface $uri) |
|
24 | { |
||
25 | 14 | return '' === $uri->getScheme() && '' !== $uri->getHost(); |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | 7 | public function buildFromParts(array $parts) |
|
32 | { |
||
33 | 7 | return Uri::fromParts($parts); |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | 12 | public function resolve(UriInterface $baseUri, UriInterface $uri) |
|
40 | { |
||
41 | 12 | return UriResolver::resolve($baseUri, $uri); |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 1 | public function appendQueryParameters(UriInterface $uri, array $parameters = []) |
|
48 | { |
||
49 | 1 | parse_str($uri->getQuery(), $existedParameters); |
|
50 | |||
51 | 1 | $mergedParameters = array_merge($existedParameters, $parameters); |
|
52 | |||
53 | 1 | return $uri->withQuery(http_build_query($mergedParameters)); |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 54 | public function toPsrUri($uri) |
|
68 | } |
||
69 | } |
||
70 |