1 | <?php |
||
47 | trait Psr7Trait |
||
48 | { |
||
49 | /** |
||
50 | * Return the URL path |
||
51 | * |
||
52 | * @return string URL path |
||
53 | */ |
||
54 | 43 | public function getPath() |
|
58 | |||
59 | /** |
||
60 | * Return the URL host |
||
61 | * |
||
62 | * @return string URL host |
||
63 | */ |
||
64 | 36 | public function getHost() |
|
68 | |||
69 | /** |
||
70 | * Return the URL port |
||
71 | * |
||
72 | * @return int URL port |
||
73 | */ |
||
74 | 12 | public function getPort() |
|
78 | |||
79 | /** |
||
80 | * Return the URL fragment |
||
81 | * |
||
82 | * @return string URL fragment |
||
83 | */ |
||
84 | 12 | public function getFragment() |
|
88 | |||
89 | /** |
||
90 | * Return the URL query |
||
91 | * |
||
92 | * @return array URL query |
||
93 | */ |
||
94 | 7 | public function getQuery() |
|
98 | |||
99 | /** |
||
100 | * Return the URL scheme |
||
101 | * |
||
102 | * @return string URL scheme |
||
103 | */ |
||
104 | 36 | public function getScheme() |
|
108 | |||
109 | /** |
||
110 | * Return the URL authority |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | 1 | public function getAuthority() |
|
120 | |||
121 | /** |
||
122 | * Return the URL user info |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | 1 | public function getUserInfo() |
|
132 | |||
133 | /** |
||
134 | * Return an instance of this URL with the given scheme |
||
135 | * |
||
136 | * @param string $scheme Scheme |
||
137 | * @return Url Instance with the given scheme |
||
138 | */ |
||
139 | 1 | public function withScheme($scheme) |
|
143 | |||
144 | /** |
||
145 | * Return an instance of this URL with the given user info |
||
146 | * |
||
147 | * @param string $user User name |
||
148 | * @param string|null $password Password |
||
149 | * @return Url URL instance with given user info |
||
150 | */ |
||
151 | 1 | public function withUserInfo($user, $password = null) |
|
155 | |||
156 | /** |
||
157 | * Return an instance of this URL with the given host |
||
158 | * |
||
159 | * @param string $host Host |
||
160 | * @return Url Instance with the given host |
||
161 | */ |
||
162 | 1 | public function withHost($host) |
|
166 | |||
167 | /** |
||
168 | * Return an instance of this URL with the given port |
||
169 | * |
||
170 | * @param null|int $port Port |
||
171 | * @return Url Instance with the given port |
||
172 | */ |
||
173 | 1 | public function withPort($port) |
|
177 | |||
178 | /** |
||
179 | * Return an instance of this URL with the given path |
||
180 | * |
||
181 | * @param null|int $path Path |
||
182 | * @return Url Instance with the given path |
||
183 | */ |
||
184 | 1 | public function withPath($path) |
|
188 | |||
189 | /** |
||
190 | * Return an instance of this URL with the given query |
||
191 | * |
||
192 | * @param null|string $query Query |
||
193 | * @return Url Instance with the given query |
||
194 | */ |
||
195 | 1 | public function withQuery($query) |
|
199 | |||
200 | /** |
||
201 | * Return an instance of this URL with the given fragment |
||
202 | * |
||
203 | * @param null|int $fragment Fragment |
||
204 | * @return Url Instance with the given fragment |
||
205 | */ |
||
206 | 1 | public function withFragment($fragment) |
|
210 | |||
211 | /** |
||
212 | * Set the URL scheme |
||
213 | * |
||
214 | * @param string $scheme URL scheme |
||
215 | * @return Url New URL |
||
216 | */ |
||
217 | abstract public function setScheme($scheme); |
||
218 | |||
219 | /** |
||
220 | * Set the URL user |
||
221 | * |
||
222 | * @param string|NULL $user URL user |
||
223 | * @return Url New URL |
||
224 | */ |
||
225 | abstract public function setUser($user); |
||
226 | |||
227 | /** |
||
228 | * Set the URL host |
||
229 | * |
||
230 | * @param string $host URL host |
||
231 | * @return Url New URL |
||
232 | */ |
||
233 | abstract public function setHost($host); |
||
234 | |||
235 | /** |
||
236 | * Set the URL port |
||
237 | * |
||
238 | * @param int|null $port URL port |
||
239 | * @return Url New URL |
||
240 | */ |
||
241 | abstract public function setPort($port); |
||
242 | |||
243 | /** |
||
244 | * Set the URL path |
||
245 | * |
||
246 | * @param string $path URL path |
||
247 | * @return Url New URL |
||
248 | */ |
||
249 | abstract public function setPath($path); |
||
250 | |||
251 | /** |
||
252 | * Set the URL query |
||
253 | * |
||
254 | * @param string $query URL query |
||
255 | * @return Url New URL |
||
256 | */ |
||
257 | abstract public function setQuery($query); |
||
258 | |||
259 | /** |
||
260 | * Set the URL fragment |
||
261 | * |
||
262 | * @param string $fragment URL fragment |
||
263 | * @return Url New URL |
||
264 | */ |
||
265 | abstract public function setFragment($fragment); |
||
266 | |||
267 | /** |
||
268 | * Return the a complete serialized URL |
||
269 | * |
||
270 | * @param array $override Override components |
||
271 | * @return string Serialized URL |
||
272 | */ |
||
273 | abstract protected function getUrlInternal(array &$override = []); |
||
274 | } |
||
275 |