1 | <?php |
||
10 | class Uri implements UriInterface |
||
11 | { |
||
12 | |||
13 | |||
14 | private $scheme; |
||
15 | |||
16 | public function withScheme($value) |
||
22 | |||
23 | public function getScheme() |
||
27 | |||
28 | private $username; |
||
29 | private $password; |
||
30 | |||
31 | public function withUserInfo($user, $password = null) |
||
38 | |||
39 | public function getUserInfo() |
||
44 | |||
45 | /** |
||
46 | * @return mixed |
||
47 | */ |
||
48 | public function getUsername() |
||
52 | |||
53 | /** |
||
54 | * @return mixed |
||
55 | */ |
||
56 | public function getPassword() |
||
60 | |||
61 | private $host; |
||
62 | |||
63 | public function withHost($value) |
||
69 | |||
70 | public function getHost() |
||
74 | |||
75 | private $port; |
||
76 | |||
77 | /** |
||
78 | * @param int|string|null $value |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function withPort($value) |
||
87 | |||
88 | public function getPort() |
||
92 | |||
93 | private $path; |
||
94 | |||
95 | public function withPath($value) |
||
101 | |||
102 | public function getPath() |
||
106 | |||
107 | private $query = []; |
||
108 | |||
109 | public function withQuery($query) |
||
115 | |||
116 | protected function setQuery($query) |
||
121 | |||
122 | |||
123 | public function getQuery() |
||
127 | |||
128 | /** |
||
129 | * @param string $key |
||
130 | * @param string|array $value |
||
131 | * @param bool $isEncoded |
||
132 | * @return $this |
||
133 | */ |
||
134 | public function withQueryKeyValue($key, $value, $isEncoded = false) |
||
140 | |||
141 | /** |
||
142 | * Not from UriInterface |
||
143 | * |
||
144 | * @param $key |
||
145 | * @return string |
||
146 | */ |
||
147 | public function getQueryPart($key) |
||
151 | |||
152 | private function getFromArray($array, $key) |
||
160 | |||
161 | private $fragment; |
||
162 | |||
163 | public function getFragment() |
||
167 | |||
168 | public function withFragment($fragment) |
||
174 | |||
175 | public function getAuthority() |
||
182 | |||
183 | public function __toString() |
||
192 | |||
193 | private function concatSuffix($str, $suffix) |
||
200 | |||
201 | private function concatPrefix($prefix, $str) |
||
208 | |||
209 | /** |
||
210 | * @param string $uri |
||
211 | */ |
||
212 | public function __construct($uri = null) |
||
244 | |||
245 | public static function getInstanceFromString($uriString = null) |
||
249 | |||
250 | public static function getInstanceFromUri(UriInterface $uri) |
||
254 | } |
||
255 |