Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 1... Línea 1...
1
<?php
1
<?php
-
 
2
 
2
namespace Psr\Http\Message;
3
namespace Psr\Http\Message;
Línea 3... Línea 4...
3
 
4
 
4
/**
5
/**
5
 * Value object representing a URI.
6
 * Value object representing a URI.
Línea 35... Línea 36...
35
     * added.
36
     * added.
36
     *
37
     *
37
     * @see https://tools.ietf.org/html/rfc3986#section-3.1
38
     * @see https://tools.ietf.org/html/rfc3986#section-3.1
38
     * @return string The URI scheme.
39
     * @return string The URI scheme.
39
     */
40
     */
40
    public function getScheme();
41
    public function getScheme(): string;
Línea 41... Línea 42...
41
 
42
 
42
    /**
43
    /**
43
     * Retrieve the authority component of the URI.
44
     * Retrieve the authority component of the URI.
44
     *
45
     *
Línea 55... Línea 56...
55
     * scheme, it SHOULD NOT be included.
56
     * scheme, it SHOULD NOT be included.
56
     *
57
     *
57
     * @see https://tools.ietf.org/html/rfc3986#section-3.2
58
     * @see https://tools.ietf.org/html/rfc3986#section-3.2
58
     * @return string The URI authority, in "[user-info@]host[:port]" format.
59
     * @return string The URI authority, in "[user-info@]host[:port]" format.
59
     */
60
     */
60
    public function getAuthority();
61
    public function getAuthority(): string;
Línea 61... Línea 62...
61
 
62
 
62
    /**
63
    /**
63
     * Retrieve the user information component of the URI.
64
     * Retrieve the user information component of the URI.
64
     *
65
     *
Línea 72... Línea 73...
72
     * The trailing "@" character is not part of the user information and MUST
73
     * The trailing "@" character is not part of the user information and MUST
73
     * NOT be added.
74
     * NOT be added.
74
     *
75
     *
75
     * @return string The URI user information, in "username[:password]" format.
76
     * @return string The URI user information, in "username[:password]" format.
76
     */
77
     */
77
    public function getUserInfo();
78
    public function getUserInfo(): string;
Línea 78... Línea 79...
78
 
79
 
79
    /**
80
    /**
80
     * Retrieve the host component of the URI.
81
     * Retrieve the host component of the URI.
81
     *
82
     *
Línea 85... Línea 86...
85
     * Section 3.2.2.
86
     * Section 3.2.2.
86
     *
87
     *
87
     * @see http://tools.ietf.org/html/rfc3986#section-3.2.2
88
     * @see http://tools.ietf.org/html/rfc3986#section-3.2.2
88
     * @return string The URI host.
89
     * @return string The URI host.
89
     */
90
     */
90
    public function getHost();
91
    public function getHost(): string;
Línea 91... Línea 92...
91
 
92
 
92
    /**
93
    /**
93
     * Retrieve the port component of the URI.
94
     * Retrieve the port component of the URI.
94
     *
95
     *
Línea 102... Línea 103...
102
     * If no port is present, but a scheme is present, this method MAY return
103
     * If no port is present, but a scheme is present, this method MAY return
103
     * the standard port for that scheme, but SHOULD return null.
104
     * the standard port for that scheme, but SHOULD return null.
104
     *
105
     *
105
     * @return null|int The URI port.
106
     * @return null|int The URI port.
106
     */
107
     */
107
    public function getPort();
108
    public function getPort(): ?int;
Línea 108... Línea 109...
108
 
109
 
109
    /**
110
    /**
110
     * Retrieve the path component of the URI.
111
     * Retrieve the path component of the URI.
111
     *
112
     *
Línea 129... Línea 130...
129
     *
130
     *
130
     * @see https://tools.ietf.org/html/rfc3986#section-2
131
     * @see https://tools.ietf.org/html/rfc3986#section-2
131
     * @see https://tools.ietf.org/html/rfc3986#section-3.3
132
     * @see https://tools.ietf.org/html/rfc3986#section-3.3
132
     * @return string The URI path.
133
     * @return string The URI path.
133
     */
134
     */
134
    public function getPath();
135
    public function getPath(): string;
Línea 135... Línea 136...
135
 
136
 
136
    /**
137
    /**
137
     * Retrieve the query string of the URI.
138
     * Retrieve the query string of the URI.
138
     *
139
     *
Línea 151... Línea 152...
151
     *
152
     *
152
     * @see https://tools.ietf.org/html/rfc3986#section-2
153
     * @see https://tools.ietf.org/html/rfc3986#section-2
153
     * @see https://tools.ietf.org/html/rfc3986#section-3.4
154
     * @see https://tools.ietf.org/html/rfc3986#section-3.4
154
     * @return string The URI query string.
155
     * @return string The URI query string.
155
     */
156
     */
156
    public function getQuery();
157
    public function getQuery(): string;
Línea 157... Línea 158...
157
 
158
 
158
    /**
159
    /**
159
     * Retrieve the fragment component of the URI.
160
     * Retrieve the fragment component of the URI.
160
     *
161
     *
Línea 169... Línea 170...
169
     *
170
     *
170
     * @see https://tools.ietf.org/html/rfc3986#section-2
171
     * @see https://tools.ietf.org/html/rfc3986#section-2
171
     * @see https://tools.ietf.org/html/rfc3986#section-3.5
172
     * @see https://tools.ietf.org/html/rfc3986#section-3.5
172
     * @return string The URI fragment.
173
     * @return string The URI fragment.
173
     */
174
     */
174
    public function getFragment();
175
    public function getFragment(): string;
Línea 175... Línea 176...
175
 
176
 
176
    /**
177
    /**
177
     * Return an instance with the specified scheme.
178
     * Return an instance with the specified scheme.
178
     *
179
     *
Línea 186... Línea 187...
186
     *
187
     *
187
     * @param string $scheme The scheme to use with the new instance.
188
     * @param string $scheme The scheme to use with the new instance.
188
     * @return static A new instance with the specified scheme.
189
     * @return static A new instance with the specified scheme.
189
     * @throws \InvalidArgumentException for invalid or unsupported schemes.
190
     * @throws \InvalidArgumentException for invalid or unsupported schemes.
190
     */
191
     */
191
    public function withScheme($scheme);
192
    public function withScheme(string $scheme): UriInterface;
Línea 192... Línea 193...
192
 
193
 
193
    /**
194
    /**
194
     * Return an instance with the specified user information.
195
     * Return an instance with the specified user information.
195
     *
196
     *
Línea 202... Línea 203...
202
     *
203
     *
203
     * @param string $user The user name to use for authority.
204
     * @param string $user The user name to use for authority.
204
     * @param null|string $password The password associated with $user.
205
     * @param null|string $password The password associated with $user.
205
     * @return static A new instance with the specified user information.
206
     * @return static A new instance with the specified user information.
206
     */
207
     */
207
    public function withUserInfo($user, $password = null);
208
    public function withUserInfo(string $user, ?string $password = null): UriInterface;
Línea 208... Línea 209...
208
 
209
 
209
    /**
210
    /**
210
     * Return an instance with the specified host.
211
     * Return an instance with the specified host.
211
     *
212
     *
Línea 216... Línea 217...
216
     *
217
     *
217
     * @param string $host The hostname to use with the new instance.
218
     * @param string $host The hostname to use with the new instance.
218
     * @return static A new instance with the specified host.
219
     * @return static A new instance with the specified host.
219
     * @throws \InvalidArgumentException for invalid hostnames.
220
     * @throws \InvalidArgumentException for invalid hostnames.
220
     */
221
     */
221
    public function withHost($host);
222
    public function withHost(string $host): UriInterface;
Línea 222... Línea 223...
222
 
223
 
223
    /**
224
    /**
224
     * Return an instance with the specified port.
225
     * Return an instance with the specified port.
225
     *
226
     *
Línea 235... Línea 236...
235
     * @param null|int $port The port to use with the new instance; a null value
236
     * @param null|int $port The port to use with the new instance; a null value
236
     *     removes the port information.
237
     *     removes the port information.
237
     * @return static A new instance with the specified port.
238
     * @return static A new instance with the specified port.
238
     * @throws \InvalidArgumentException for invalid ports.
239
     * @throws \InvalidArgumentException for invalid ports.
239
     */
240
     */
240
    public function withPort($port);
241
    public function withPort(?int $port): UriInterface;
Línea 241... Línea 242...
241
 
242
 
242
    /**
243
    /**
243
     * Return an instance with the specified path.
244
     * Return an instance with the specified path.
244
     *
245
     *
Línea 259... Línea 260...
259
     *
260
     *
260
     * @param string $path The path to use with the new instance.
261
     * @param string $path The path to use with the new instance.
261
     * @return static A new instance with the specified path.
262
     * @return static A new instance with the specified path.
262
     * @throws \InvalidArgumentException for invalid paths.
263
     * @throws \InvalidArgumentException for invalid paths.
263
     */
264
     */
264
    public function withPath($path);
265
    public function withPath(string $path): UriInterface;
Línea 265... Línea 266...
265
 
266
 
266
    /**
267
    /**
267
     * Return an instance with the specified query string.
268
     * Return an instance with the specified query string.
268
     *
269
     *
Línea 276... Línea 277...
276
     *
277
     *
277
     * @param string $query The query string to use with the new instance.
278
     * @param string $query The query string to use with the new instance.
278
     * @return static A new instance with the specified query string.
279
     * @return static A new instance with the specified query string.
279
     * @throws \InvalidArgumentException for invalid query strings.
280
     * @throws \InvalidArgumentException for invalid query strings.
280
     */
281
     */
281
    public function withQuery($query);
282
    public function withQuery(string $query): UriInterface;
Línea 282... Línea 283...
282
 
283
 
283
    /**
284
    /**
284
     * Return an instance with the specified URI fragment.
285
     * Return an instance with the specified URI fragment.
285
     *
286
     *
Línea 292... Línea 293...
292
     * An empty fragment value is equivalent to removing the fragment.
293
     * An empty fragment value is equivalent to removing the fragment.
293
     *
294
     *
294
     * @param string $fragment The fragment to use with the new instance.
295
     * @param string $fragment The fragment to use with the new instance.
295
     * @return static A new instance with the specified fragment.
296
     * @return static A new instance with the specified fragment.
296
     */
297
     */
297
    public function withFragment($fragment);
298
    public function withFragment(string $fragment): UriInterface;
Línea 298... Línea 299...
298
 
299
 
299
    /**
300
    /**
300
     * Return the string representation as a URI reference.
301
     * Return the string representation as a URI reference.
301
     *
302
     *
Línea 317... Línea 318...
317
     * - If a fragment is present, it MUST be prefixed by "#".
318
     * - If a fragment is present, it MUST be prefixed by "#".
318
     *
319
     *
319
     * @see http://tools.ietf.org/html/rfc3986#section-4.1
320
     * @see http://tools.ietf.org/html/rfc3986#section-4.1
320
     * @return string
321
     * @return string
321
     */
322
     */
322
    public function __toString();
323
    public function __toString(): string;
323
}
324
}