1 | <?php |
||
12 | final class UrlFactory |
||
13 | { |
||
14 | /** |
||
15 | * @var \Marek\OpenWeatherMap\API\Value\Configuration\APIConfiguration |
||
16 | */ |
||
17 | private $configuration; |
||
18 | |||
19 | /** |
||
20 | * UrlFactory constructor. |
||
21 | * |
||
22 | * @param \Marek\OpenWeatherMap\API\Value\Configuration\APIConfiguration $configuration |
||
23 | */ |
||
24 | public function __construct(APIConfiguration $configuration) |
||
28 | |||
29 | /** |
||
30 | * @param \Marek\OpenWeatherMap\API\Value\Parameter\InputParameterBag $bag |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | public function build(InputParameterBag $bag): string |
||
41 | |||
42 | /** |
||
43 | * @param string $url |
||
44 | * |
||
45 | * @return \Marek\OpenWeatherMap\API\Value\Parameter\InputParameterBag |
||
46 | */ |
||
47 | public function buildBag(string $url): InputParameterBag |
||
51 | |||
52 | /** |
||
53 | * Transforms Uri paramters. |
||
54 | * |
||
55 | * @param string $url |
||
56 | * @param \Marek\OpenWeatherMap\API\Value\Parameter\InputParameterBag $bag |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | private function transformUriParameters(string $url, InputParameterBag $bag): string |
||
71 | |||
72 | /** |
||
73 | * Transforms Uri GET parameters. |
||
74 | * |
||
75 | * @param string $url |
||
76 | * @param \Marek\OpenWeatherMap\API\Value\Parameter\InputParameterBag $bag |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | private function transformGetParameters(string $url, InputParameterBag $bag): string |
||
96 | } |
||
97 |