@@ -12,8 +12,7 @@ |
||
12 | 12 | * Implementors can extend the class and implement abstract methods to run this |
13 | 13 | * as part of their test suite. |
14 | 14 | */ |
15 | -abstract class LoggerInterfaceTest extends TestCase |
|
16 | -{ |
|
15 | +abstract class LoggerInterfaceTest extends TestCase { |
|
17 | 16 | /** |
18 | 17 | * @return LoggerInterface |
19 | 18 | */ |
@@ -13,81 +13,81 @@ |
||
13 | 13 | */ |
14 | 14 | abstract class LoggerInterfaceTest extends TestCase |
15 | 15 | { |
16 | - /** |
|
17 | - * @return LoggerInterface |
|
18 | - */ |
|
19 | - public abstract function getLogger(); |
|
20 | - /** |
|
21 | - * This must return the log messages in order. |
|
22 | - * |
|
23 | - * The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>". |
|
24 | - * |
|
25 | - * Example ->error('Foo') would yield "error Foo". |
|
26 | - * |
|
27 | - * @return string[] |
|
28 | - */ |
|
29 | - public abstract function getLogs(); |
|
30 | - public function testImplements() |
|
31 | - { |
|
32 | - $this->assertInstanceOf('OCA\\FullTextSearch_Elasticsearch\\Vendor\\Psr\\Log\\LoggerInterface', $this->getLogger()); |
|
33 | - } |
|
34 | - /** |
|
35 | - * @dataProvider provideLevelsAndMessages |
|
36 | - */ |
|
37 | - public function testLogsAtAllLevels($level, $message) |
|
38 | - { |
|
39 | - $logger = $this->getLogger(); |
|
40 | - $logger->{$level}($message, array('user' => 'Bob')); |
|
41 | - $logger->log($level, $message, array('user' => 'Bob')); |
|
42 | - $expected = array($level . ' message of level ' . $level . ' with context: Bob', $level . ' message of level ' . $level . ' with context: Bob'); |
|
43 | - $this->assertEquals($expected, $this->getLogs()); |
|
44 | - } |
|
45 | - public function provideLevelsAndMessages() |
|
46 | - { |
|
47 | - return array(LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}')); |
|
48 | - } |
|
49 | - /** |
|
50 | - * @expectedException \Psr\Log\InvalidArgumentException |
|
51 | - */ |
|
52 | - public function testThrowsOnInvalidLevel() |
|
53 | - { |
|
54 | - $logger = $this->getLogger(); |
|
55 | - $logger->log('invalid level', 'Foo'); |
|
56 | - } |
|
57 | - public function testContextReplacement() |
|
58 | - { |
|
59 | - $logger = $this->getLogger(); |
|
60 | - $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); |
|
61 | - $expected = array('info {Message {nothing} Bob Bar a}'); |
|
62 | - $this->assertEquals($expected, $this->getLogs()); |
|
63 | - } |
|
64 | - public function testObjectCastToString() |
|
65 | - { |
|
66 | - if (\method_exists($this, 'createPartialMock')) { |
|
67 | - $dummy = $this->createPartialMock('OCA\\FullTextSearch_Elasticsearch\\Vendor\\Psr\\Log\\Test\\DummyTest', array('__toString')); |
|
68 | - } else { |
|
69 | - $dummy = $this->getMock('OCA\\FullTextSearch_Elasticsearch\\Vendor\\Psr\\Log\\Test\\DummyTest', array('__toString')); |
|
70 | - } |
|
71 | - $dummy->expects($this->once())->method('__toString')->will($this->returnValue('DUMMY')); |
|
72 | - $this->getLogger()->warning($dummy); |
|
73 | - $expected = array('warning DUMMY'); |
|
74 | - $this->assertEquals($expected, $this->getLogs()); |
|
75 | - } |
|
76 | - public function testContextCanContainAnything() |
|
77 | - { |
|
78 | - $closed = \fopen('php://memory', 'r'); |
|
79 | - \fclose($closed); |
|
80 | - $context = array('bool' => \true, 'null' => null, 'string' => 'Foo', 'int' => 0, 'float' => 0.5, 'nested' => array('with object' => new DummyTest()), 'object' => new \DateTime(), 'resource' => \fopen('php://memory', 'r'), 'closed' => $closed); |
|
81 | - $this->getLogger()->warning('Crazy context data', $context); |
|
82 | - $expected = array('warning Crazy context data'); |
|
83 | - $this->assertEquals($expected, $this->getLogs()); |
|
84 | - } |
|
85 | - public function testContextExceptionKeyCanBeExceptionOrOtherValues() |
|
86 | - { |
|
87 | - $logger = $this->getLogger(); |
|
88 | - $logger->warning('Random message', array('exception' => 'oops')); |
|
89 | - $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); |
|
90 | - $expected = array('warning Random message', 'critical Uncaught Exception!'); |
|
91 | - $this->assertEquals($expected, $this->getLogs()); |
|
92 | - } |
|
16 | + /** |
|
17 | + * @return LoggerInterface |
|
18 | + */ |
|
19 | + public abstract function getLogger(); |
|
20 | + /** |
|
21 | + * This must return the log messages in order. |
|
22 | + * |
|
23 | + * The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>". |
|
24 | + * |
|
25 | + * Example ->error('Foo') would yield "error Foo". |
|
26 | + * |
|
27 | + * @return string[] |
|
28 | + */ |
|
29 | + public abstract function getLogs(); |
|
30 | + public function testImplements() |
|
31 | + { |
|
32 | + $this->assertInstanceOf('OCA\\FullTextSearch_Elasticsearch\\Vendor\\Psr\\Log\\LoggerInterface', $this->getLogger()); |
|
33 | + } |
|
34 | + /** |
|
35 | + * @dataProvider provideLevelsAndMessages |
|
36 | + */ |
|
37 | + public function testLogsAtAllLevels($level, $message) |
|
38 | + { |
|
39 | + $logger = $this->getLogger(); |
|
40 | + $logger->{$level}($message, array('user' => 'Bob')); |
|
41 | + $logger->log($level, $message, array('user' => 'Bob')); |
|
42 | + $expected = array($level . ' message of level ' . $level . ' with context: Bob', $level . ' message of level ' . $level . ' with context: Bob'); |
|
43 | + $this->assertEquals($expected, $this->getLogs()); |
|
44 | + } |
|
45 | + public function provideLevelsAndMessages() |
|
46 | + { |
|
47 | + return array(LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}')); |
|
48 | + } |
|
49 | + /** |
|
50 | + * @expectedException \Psr\Log\InvalidArgumentException |
|
51 | + */ |
|
52 | + public function testThrowsOnInvalidLevel() |
|
53 | + { |
|
54 | + $logger = $this->getLogger(); |
|
55 | + $logger->log('invalid level', 'Foo'); |
|
56 | + } |
|
57 | + public function testContextReplacement() |
|
58 | + { |
|
59 | + $logger = $this->getLogger(); |
|
60 | + $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); |
|
61 | + $expected = array('info {Message {nothing} Bob Bar a}'); |
|
62 | + $this->assertEquals($expected, $this->getLogs()); |
|
63 | + } |
|
64 | + public function testObjectCastToString() |
|
65 | + { |
|
66 | + if (\method_exists($this, 'createPartialMock')) { |
|
67 | + $dummy = $this->createPartialMock('OCA\\FullTextSearch_Elasticsearch\\Vendor\\Psr\\Log\\Test\\DummyTest', array('__toString')); |
|
68 | + } else { |
|
69 | + $dummy = $this->getMock('OCA\\FullTextSearch_Elasticsearch\\Vendor\\Psr\\Log\\Test\\DummyTest', array('__toString')); |
|
70 | + } |
|
71 | + $dummy->expects($this->once())->method('__toString')->will($this->returnValue('DUMMY')); |
|
72 | + $this->getLogger()->warning($dummy); |
|
73 | + $expected = array('warning DUMMY'); |
|
74 | + $this->assertEquals($expected, $this->getLogs()); |
|
75 | + } |
|
76 | + public function testContextCanContainAnything() |
|
77 | + { |
|
78 | + $closed = \fopen('php://memory', 'r'); |
|
79 | + \fclose($closed); |
|
80 | + $context = array('bool' => \true, 'null' => null, 'string' => 'Foo', 'int' => 0, 'float' => 0.5, 'nested' => array('with object' => new DummyTest()), 'object' => new \DateTime(), 'resource' => \fopen('php://memory', 'r'), 'closed' => $closed); |
|
81 | + $this->getLogger()->warning('Crazy context data', $context); |
|
82 | + $expected = array('warning Crazy context data'); |
|
83 | + $this->assertEquals($expected, $this->getLogs()); |
|
84 | + } |
|
85 | + public function testContextExceptionKeyCanBeExceptionOrOtherValues() |
|
86 | + { |
|
87 | + $logger = $this->getLogger(); |
|
88 | + $logger->warning('Random message', array('exception' => 'oops')); |
|
89 | + $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); |
|
90 | + $expected = array('warning Random message', 'critical Uncaught Exception!'); |
|
91 | + $this->assertEquals($expected, $this->getLogs()); |
|
92 | + } |
|
93 | 93 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $logger = $this->getLogger(); |
40 | 40 | $logger->{$level}($message, array('user' => 'Bob')); |
41 | 41 | $logger->log($level, $message, array('user' => 'Bob')); |
42 | - $expected = array($level . ' message of level ' . $level . ' with context: Bob', $level . ' message of level ' . $level . ' with context: Bob'); |
|
42 | + $expected = array($level.' message of level '.$level.' with context: Bob', $level.' message of level '.$level.' with context: Bob'); |
|
43 | 43 | $this->assertEquals($expected, $this->getLogs()); |
44 | 44 | } |
45 | 45 | public function provideLevelsAndMessages() |
@@ -11,8 +11,8 @@ |
||
11 | 11 | */ |
12 | 12 | class DummyTest |
13 | 13 | { |
14 | - public function __toString() |
|
15 | - { |
|
16 | - return 'DummyTest'; |
|
17 | - } |
|
14 | + public function __toString() |
|
15 | + { |
|
16 | + return 'DummyTest'; |
|
17 | + } |
|
18 | 18 | } |
@@ -9,8 +9,7 @@ |
||
9 | 9 | * |
10 | 10 | * @internal |
11 | 11 | */ |
12 | -class DummyTest |
|
13 | -{ |
|
12 | +class DummyTest { |
|
14 | 13 | public function __toString() |
15 | 14 | { |
16 | 15 | return 'DummyTest'; |
@@ -10,8 +10,7 @@ |
||
10 | 10 | * is a good way to avoid littering your code with `if ($this->logger) { }` |
11 | 11 | * blocks. |
12 | 12 | */ |
13 | -class NullLogger extends AbstractLogger |
|
14 | -{ |
|
13 | +class NullLogger extends AbstractLogger { |
|
15 | 14 | /** |
16 | 15 | * Logs with an arbitrary level. |
17 | 16 | * |
@@ -12,19 +12,19 @@ |
||
12 | 12 | */ |
13 | 13 | class NullLogger extends AbstractLogger |
14 | 14 | { |
15 | - /** |
|
16 | - * Logs with an arbitrary level. |
|
17 | - * |
|
18 | - * @param mixed $level |
|
19 | - * @param string $message |
|
20 | - * @param array $context |
|
21 | - * |
|
22 | - * @return void |
|
23 | - * |
|
24 | - * @throws \Psr\Log\InvalidArgumentException |
|
25 | - */ |
|
26 | - public function log($level, $message, array $context = array()) |
|
27 | - { |
|
28 | - // noop |
|
29 | - } |
|
15 | + /** |
|
16 | + * Logs with an arbitrary level. |
|
17 | + * |
|
18 | + * @param mixed $level |
|
19 | + * @param string $message |
|
20 | + * @param array $context |
|
21 | + * |
|
22 | + * @return void |
|
23 | + * |
|
24 | + * @throws \Psr\Log\InvalidArgumentException |
|
25 | + */ |
|
26 | + public function log($level, $message, array $context = array()) |
|
27 | + { |
|
28 | + // noop |
|
29 | + } |
|
30 | 30 | } |
@@ -7,12 +7,12 @@ |
||
7 | 7 | */ |
8 | 8 | interface LoggerAwareInterface |
9 | 9 | { |
10 | - /** |
|
11 | - * Sets a logger instance on the object. |
|
12 | - * |
|
13 | - * @param LoggerInterface $logger |
|
14 | - * |
|
15 | - * @return void |
|
16 | - */ |
|
17 | - public function setLogger(LoggerInterface $logger); |
|
10 | + /** |
|
11 | + * Sets a logger instance on the object. |
|
12 | + * |
|
13 | + * @param LoggerInterface $logger |
|
14 | + * |
|
15 | + * @return void |
|
16 | + */ |
|
17 | + public function setLogger(LoggerInterface $logger); |
|
18 | 18 | } |
@@ -5,8 +5,7 @@ |
||
5 | 5 | /** |
6 | 6 | * Describes a logger-aware instance. |
7 | 7 | */ |
8 | -interface LoggerAwareInterface |
|
9 | -{ |
|
8 | +interface LoggerAwareInterface { |
|
10 | 9 | /** |
11 | 10 | * Sets a logger instance on the object. |
12 | 11 | * |
@@ -22,8 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @link http://tools.ietf.org/html/rfc3986 (the URI specification) |
24 | 24 | */ |
25 | -interface UriInterface |
|
26 | -{ |
|
25 | +interface UriInterface { |
|
27 | 26 | /** |
28 | 27 | * Retrieve the scheme component of the URI. |
29 | 28 | * |
@@ -24,286 +24,286 @@ |
||
24 | 24 | */ |
25 | 25 | interface UriInterface |
26 | 26 | { |
27 | - /** |
|
28 | - * Retrieve the scheme component of the URI. |
|
29 | - * |
|
30 | - * If no scheme is present, this method MUST return an empty string. |
|
31 | - * |
|
32 | - * The value returned MUST be normalized to lowercase, per RFC 3986 |
|
33 | - * Section 3.1. |
|
34 | - * |
|
35 | - * The trailing ":" character is not part of the scheme and MUST NOT be |
|
36 | - * added. |
|
37 | - * |
|
38 | - * @see https://tools.ietf.org/html/rfc3986#section-3.1 |
|
39 | - * @return string The URI scheme. |
|
40 | - */ |
|
41 | - public function getScheme() : string; |
|
42 | - /** |
|
43 | - * Retrieve the authority component of the URI. |
|
44 | - * |
|
45 | - * If no authority information is present, this method MUST return an empty |
|
46 | - * string. |
|
47 | - * |
|
48 | - * The authority syntax of the URI is: |
|
49 | - * |
|
50 | - * <pre> |
|
51 | - * [user-info@]host[:port] |
|
52 | - * </pre> |
|
53 | - * |
|
54 | - * If the port component is not set or is the standard port for the current |
|
55 | - * scheme, it SHOULD NOT be included. |
|
56 | - * |
|
57 | - * @see https://tools.ietf.org/html/rfc3986#section-3.2 |
|
58 | - * @return string The URI authority, in "[user-info@]host[:port]" format. |
|
59 | - */ |
|
60 | - public function getAuthority() : string; |
|
61 | - /** |
|
62 | - * Retrieve the user information component of the URI. |
|
63 | - * |
|
64 | - * If no user information is present, this method MUST return an empty |
|
65 | - * string. |
|
66 | - * |
|
67 | - * If a user is present in the URI, this will return that value; |
|
68 | - * additionally, if the password is also present, it will be appended to the |
|
69 | - * user value, with a colon (":") separating the values. |
|
70 | - * |
|
71 | - * The trailing "@" character is not part of the user information and MUST |
|
72 | - * NOT be added. |
|
73 | - * |
|
74 | - * @return string The URI user information, in "username[:password]" format. |
|
75 | - */ |
|
76 | - public function getUserInfo() : string; |
|
77 | - /** |
|
78 | - * Retrieve the host component of the URI. |
|
79 | - * |
|
80 | - * If no host is present, this method MUST return an empty string. |
|
81 | - * |
|
82 | - * The value returned MUST be normalized to lowercase, per RFC 3986 |
|
83 | - * Section 3.2.2. |
|
84 | - * |
|
85 | - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 |
|
86 | - * @return string The URI host. |
|
87 | - */ |
|
88 | - public function getHost() : string; |
|
89 | - /** |
|
90 | - * Retrieve the port component of the URI. |
|
91 | - * |
|
92 | - * If a port is present, and it is non-standard for the current scheme, |
|
93 | - * this method MUST return it as an integer. If the port is the standard port |
|
94 | - * used with the current scheme, this method SHOULD return null. |
|
95 | - * |
|
96 | - * If no port is present, and no scheme is present, this method MUST return |
|
97 | - * a null value. |
|
98 | - * |
|
99 | - * If no port is present, but a scheme is present, this method MAY return |
|
100 | - * the standard port for that scheme, but SHOULD return null. |
|
101 | - * |
|
102 | - * @return null|int The URI port. |
|
103 | - */ |
|
104 | - public function getPort() : ?int; |
|
105 | - /** |
|
106 | - * Retrieve the path component of the URI. |
|
107 | - * |
|
108 | - * The path can either be empty or absolute (starting with a slash) or |
|
109 | - * rootless (not starting with a slash). Implementations MUST support all |
|
110 | - * three syntaxes. |
|
111 | - * |
|
112 | - * Normally, the empty path "" and absolute path "/" are considered equal as |
|
113 | - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically |
|
114 | - * do this normalization because in contexts with a trimmed base path, e.g. |
|
115 | - * the front controller, this difference becomes significant. It's the task |
|
116 | - * of the user to handle both "" and "/". |
|
117 | - * |
|
118 | - * The value returned MUST be percent-encoded, but MUST NOT double-encode |
|
119 | - * any characters. To determine what characters to encode, please refer to |
|
120 | - * RFC 3986, Sections 2 and 3.3. |
|
121 | - * |
|
122 | - * As an example, if the value should include a slash ("/") not intended as |
|
123 | - * delimiter between path segments, that value MUST be passed in encoded |
|
124 | - * form (e.g., "%2F") to the instance. |
|
125 | - * |
|
126 | - * @see https://tools.ietf.org/html/rfc3986#section-2 |
|
127 | - * @see https://tools.ietf.org/html/rfc3986#section-3.3 |
|
128 | - * @return string The URI path. |
|
129 | - */ |
|
130 | - public function getPath() : string; |
|
131 | - /** |
|
132 | - * Retrieve the query string of the URI. |
|
133 | - * |
|
134 | - * If no query string is present, this method MUST return an empty string. |
|
135 | - * |
|
136 | - * The leading "?" character is not part of the query and MUST NOT be |
|
137 | - * added. |
|
138 | - * |
|
139 | - * The value returned MUST be percent-encoded, but MUST NOT double-encode |
|
140 | - * any characters. To determine what characters to encode, please refer to |
|
141 | - * RFC 3986, Sections 2 and 3.4. |
|
142 | - * |
|
143 | - * As an example, if a value in a key/value pair of the query string should |
|
144 | - * include an ampersand ("&") not intended as a delimiter between values, |
|
145 | - * that value MUST be passed in encoded form (e.g., "%26") to the instance. |
|
146 | - * |
|
147 | - * @see https://tools.ietf.org/html/rfc3986#section-2 |
|
148 | - * @see https://tools.ietf.org/html/rfc3986#section-3.4 |
|
149 | - * @return string The URI query string. |
|
150 | - */ |
|
151 | - public function getQuery() : string; |
|
152 | - /** |
|
153 | - * Retrieve the fragment component of the URI. |
|
154 | - * |
|
155 | - * If no fragment is present, this method MUST return an empty string. |
|
156 | - * |
|
157 | - * The leading "#" character is not part of the fragment and MUST NOT be |
|
158 | - * added. |
|
159 | - * |
|
160 | - * The value returned MUST be percent-encoded, but MUST NOT double-encode |
|
161 | - * any characters. To determine what characters to encode, please refer to |
|
162 | - * RFC 3986, Sections 2 and 3.5. |
|
163 | - * |
|
164 | - * @see https://tools.ietf.org/html/rfc3986#section-2 |
|
165 | - * @see https://tools.ietf.org/html/rfc3986#section-3.5 |
|
166 | - * @return string The URI fragment. |
|
167 | - */ |
|
168 | - public function getFragment() : string; |
|
169 | - /** |
|
170 | - * Return an instance with the specified scheme. |
|
171 | - * |
|
172 | - * This method MUST retain the state of the current instance, and return |
|
173 | - * an instance that contains the specified scheme. |
|
174 | - * |
|
175 | - * Implementations MUST support the schemes "http" and "https" case |
|
176 | - * insensitively, and MAY accommodate other schemes if required. |
|
177 | - * |
|
178 | - * An empty scheme is equivalent to removing the scheme. |
|
179 | - * |
|
180 | - * @param string $scheme The scheme to use with the new instance. |
|
181 | - * @return static A new instance with the specified scheme. |
|
182 | - * @throws \InvalidArgumentException for invalid or unsupported schemes. |
|
183 | - */ |
|
184 | - public function withScheme(string $scheme) : UriInterface; |
|
185 | - /** |
|
186 | - * Return an instance with the specified user information. |
|
187 | - * |
|
188 | - * This method MUST retain the state of the current instance, and return |
|
189 | - * an instance that contains the specified user information. |
|
190 | - * |
|
191 | - * Password is optional, but the user information MUST include the |
|
192 | - * user; an empty string for the user is equivalent to removing user |
|
193 | - * information. |
|
194 | - * |
|
195 | - * @param string $user The user name to use for authority. |
|
196 | - * @param null|string $password The password associated with $user. |
|
197 | - * @return static A new instance with the specified user information. |
|
198 | - */ |
|
199 | - public function withUserInfo(string $user, ?string $password = null) : UriInterface; |
|
200 | - /** |
|
201 | - * Return an instance with the specified host. |
|
202 | - * |
|
203 | - * This method MUST retain the state of the current instance, and return |
|
204 | - * an instance that contains the specified host. |
|
205 | - * |
|
206 | - * An empty host value is equivalent to removing the host. |
|
207 | - * |
|
208 | - * @param string $host The hostname to use with the new instance. |
|
209 | - * @return static A new instance with the specified host. |
|
210 | - * @throws \InvalidArgumentException for invalid hostnames. |
|
211 | - */ |
|
212 | - public function withHost(string $host) : UriInterface; |
|
213 | - /** |
|
214 | - * Return an instance with the specified port. |
|
215 | - * |
|
216 | - * This method MUST retain the state of the current instance, and return |
|
217 | - * an instance that contains the specified port. |
|
218 | - * |
|
219 | - * Implementations MUST raise an exception for ports outside the |
|
220 | - * established TCP and UDP port ranges. |
|
221 | - * |
|
222 | - * A null value provided for the port is equivalent to removing the port |
|
223 | - * information. |
|
224 | - * |
|
225 | - * @param null|int $port The port to use with the new instance; a null value |
|
226 | - * removes the port information. |
|
227 | - * @return static A new instance with the specified port. |
|
228 | - * @throws \InvalidArgumentException for invalid ports. |
|
229 | - */ |
|
230 | - public function withPort(?int $port) : UriInterface; |
|
231 | - /** |
|
232 | - * Return an instance with the specified path. |
|
233 | - * |
|
234 | - * This method MUST retain the state of the current instance, and return |
|
235 | - * an instance that contains the specified path. |
|
236 | - * |
|
237 | - * The path can either be empty or absolute (starting with a slash) or |
|
238 | - * rootless (not starting with a slash). Implementations MUST support all |
|
239 | - * three syntaxes. |
|
240 | - * |
|
241 | - * If the path is intended to be domain-relative rather than path relative then |
|
242 | - * it must begin with a slash ("/"). Paths not starting with a slash ("/") |
|
243 | - * are assumed to be relative to some base path known to the application or |
|
244 | - * consumer. |
|
245 | - * |
|
246 | - * Users can provide both encoded and decoded path characters. |
|
247 | - * Implementations ensure the correct encoding as outlined in getPath(). |
|
248 | - * |
|
249 | - * @param string $path The path to use with the new instance. |
|
250 | - * @return static A new instance with the specified path. |
|
251 | - * @throws \InvalidArgumentException for invalid paths. |
|
252 | - */ |
|
253 | - public function withPath(string $path) : UriInterface; |
|
254 | - /** |
|
255 | - * Return an instance with the specified query string. |
|
256 | - * |
|
257 | - * This method MUST retain the state of the current instance, and return |
|
258 | - * an instance that contains the specified query string. |
|
259 | - * |
|
260 | - * Users can provide both encoded and decoded query characters. |
|
261 | - * Implementations ensure the correct encoding as outlined in getQuery(). |
|
262 | - * |
|
263 | - * An empty query string value is equivalent to removing the query string. |
|
264 | - * |
|
265 | - * @param string $query The query string to use with the new instance. |
|
266 | - * @return static A new instance with the specified query string. |
|
267 | - * @throws \InvalidArgumentException for invalid query strings. |
|
268 | - */ |
|
269 | - public function withQuery(string $query) : UriInterface; |
|
270 | - /** |
|
271 | - * Return an instance with the specified URI fragment. |
|
272 | - * |
|
273 | - * This method MUST retain the state of the current instance, and return |
|
274 | - * an instance that contains the specified URI fragment. |
|
275 | - * |
|
276 | - * Users can provide both encoded and decoded fragment characters. |
|
277 | - * Implementations ensure the correct encoding as outlined in getFragment(). |
|
278 | - * |
|
279 | - * An empty fragment value is equivalent to removing the fragment. |
|
280 | - * |
|
281 | - * @param string $fragment The fragment to use with the new instance. |
|
282 | - * @return static A new instance with the specified fragment. |
|
283 | - */ |
|
284 | - public function withFragment(string $fragment) : UriInterface; |
|
285 | - /** |
|
286 | - * Return the string representation as a URI reference. |
|
287 | - * |
|
288 | - * Depending on which components of the URI are present, the resulting |
|
289 | - * string is either a full URI or relative reference according to RFC 3986, |
|
290 | - * Section 4.1. The method concatenates the various components of the URI, |
|
291 | - * using the appropriate delimiters: |
|
292 | - * |
|
293 | - * - If a scheme is present, it MUST be suffixed by ":". |
|
294 | - * - If an authority is present, it MUST be prefixed by "//". |
|
295 | - * - The path can be concatenated without delimiters. But there are two |
|
296 | - * cases where the path has to be adjusted to make the URI reference |
|
297 | - * valid as PHP does not allow to throw an exception in __toString(): |
|
298 | - * - If the path is rootless and an authority is present, the path MUST |
|
299 | - * be prefixed by "/". |
|
300 | - * - If the path is starting with more than one "/" and no authority is |
|
301 | - * present, the starting slashes MUST be reduced to one. |
|
302 | - * - If a query is present, it MUST be prefixed by "?". |
|
303 | - * - If a fragment is present, it MUST be prefixed by "#". |
|
304 | - * |
|
305 | - * @see http://tools.ietf.org/html/rfc3986#section-4.1 |
|
306 | - * @return string |
|
307 | - */ |
|
308 | - public function __toString() : string; |
|
27 | + /** |
|
28 | + * Retrieve the scheme component of the URI. |
|
29 | + * |
|
30 | + * If no scheme is present, this method MUST return an empty string. |
|
31 | + * |
|
32 | + * The value returned MUST be normalized to lowercase, per RFC 3986 |
|
33 | + * Section 3.1. |
|
34 | + * |
|
35 | + * The trailing ":" character is not part of the scheme and MUST NOT be |
|
36 | + * added. |
|
37 | + * |
|
38 | + * @see https://tools.ietf.org/html/rfc3986#section-3.1 |
|
39 | + * @return string The URI scheme. |
|
40 | + */ |
|
41 | + public function getScheme() : string; |
|
42 | + /** |
|
43 | + * Retrieve the authority component of the URI. |
|
44 | + * |
|
45 | + * If no authority information is present, this method MUST return an empty |
|
46 | + * string. |
|
47 | + * |
|
48 | + * The authority syntax of the URI is: |
|
49 | + * |
|
50 | + * <pre> |
|
51 | + * [user-info@]host[:port] |
|
52 | + * </pre> |
|
53 | + * |
|
54 | + * If the port component is not set or is the standard port for the current |
|
55 | + * scheme, it SHOULD NOT be included. |
|
56 | + * |
|
57 | + * @see https://tools.ietf.org/html/rfc3986#section-3.2 |
|
58 | + * @return string The URI authority, in "[user-info@]host[:port]" format. |
|
59 | + */ |
|
60 | + public function getAuthority() : string; |
|
61 | + /** |
|
62 | + * Retrieve the user information component of the URI. |
|
63 | + * |
|
64 | + * If no user information is present, this method MUST return an empty |
|
65 | + * string. |
|
66 | + * |
|
67 | + * If a user is present in the URI, this will return that value; |
|
68 | + * additionally, if the password is also present, it will be appended to the |
|
69 | + * user value, with a colon (":") separating the values. |
|
70 | + * |
|
71 | + * The trailing "@" character is not part of the user information and MUST |
|
72 | + * NOT be added. |
|
73 | + * |
|
74 | + * @return string The URI user information, in "username[:password]" format. |
|
75 | + */ |
|
76 | + public function getUserInfo() : string; |
|
77 | + /** |
|
78 | + * Retrieve the host component of the URI. |
|
79 | + * |
|
80 | + * If no host is present, this method MUST return an empty string. |
|
81 | + * |
|
82 | + * The value returned MUST be normalized to lowercase, per RFC 3986 |
|
83 | + * Section 3.2.2. |
|
84 | + * |
|
85 | + * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 |
|
86 | + * @return string The URI host. |
|
87 | + */ |
|
88 | + public function getHost() : string; |
|
89 | + /** |
|
90 | + * Retrieve the port component of the URI. |
|
91 | + * |
|
92 | + * If a port is present, and it is non-standard for the current scheme, |
|
93 | + * this method MUST return it as an integer. If the port is the standard port |
|
94 | + * used with the current scheme, this method SHOULD return null. |
|
95 | + * |
|
96 | + * If no port is present, and no scheme is present, this method MUST return |
|
97 | + * a null value. |
|
98 | + * |
|
99 | + * If no port is present, but a scheme is present, this method MAY return |
|
100 | + * the standard port for that scheme, but SHOULD return null. |
|
101 | + * |
|
102 | + * @return null|int The URI port. |
|
103 | + */ |
|
104 | + public function getPort() : ?int; |
|
105 | + /** |
|
106 | + * Retrieve the path component of the URI. |
|
107 | + * |
|
108 | + * The path can either be empty or absolute (starting with a slash) or |
|
109 | + * rootless (not starting with a slash). Implementations MUST support all |
|
110 | + * three syntaxes. |
|
111 | + * |
|
112 | + * Normally, the empty path "" and absolute path "/" are considered equal as |
|
113 | + * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically |
|
114 | + * do this normalization because in contexts with a trimmed base path, e.g. |
|
115 | + * the front controller, this difference becomes significant. It's the task |
|
116 | + * of the user to handle both "" and "/". |
|
117 | + * |
|
118 | + * The value returned MUST be percent-encoded, but MUST NOT double-encode |
|
119 | + * any characters. To determine what characters to encode, please refer to |
|
120 | + * RFC 3986, Sections 2 and 3.3. |
|
121 | + * |
|
122 | + * As an example, if the value should include a slash ("/") not intended as |
|
123 | + * delimiter between path segments, that value MUST be passed in encoded |
|
124 | + * form (e.g., "%2F") to the instance. |
|
125 | + * |
|
126 | + * @see https://tools.ietf.org/html/rfc3986#section-2 |
|
127 | + * @see https://tools.ietf.org/html/rfc3986#section-3.3 |
|
128 | + * @return string The URI path. |
|
129 | + */ |
|
130 | + public function getPath() : string; |
|
131 | + /** |
|
132 | + * Retrieve the query string of the URI. |
|
133 | + * |
|
134 | + * If no query string is present, this method MUST return an empty string. |
|
135 | + * |
|
136 | + * The leading "?" character is not part of the query and MUST NOT be |
|
137 | + * added. |
|
138 | + * |
|
139 | + * The value returned MUST be percent-encoded, but MUST NOT double-encode |
|
140 | + * any characters. To determine what characters to encode, please refer to |
|
141 | + * RFC 3986, Sections 2 and 3.4. |
|
142 | + * |
|
143 | + * As an example, if a value in a key/value pair of the query string should |
|
144 | + * include an ampersand ("&") not intended as a delimiter between values, |
|
145 | + * that value MUST be passed in encoded form (e.g., "%26") to the instance. |
|
146 | + * |
|
147 | + * @see https://tools.ietf.org/html/rfc3986#section-2 |
|
148 | + * @see https://tools.ietf.org/html/rfc3986#section-3.4 |
|
149 | + * @return string The URI query string. |
|
150 | + */ |
|
151 | + public function getQuery() : string; |
|
152 | + /** |
|
153 | + * Retrieve the fragment component of the URI. |
|
154 | + * |
|
155 | + * If no fragment is present, this method MUST return an empty string. |
|
156 | + * |
|
157 | + * The leading "#" character is not part of the fragment and MUST NOT be |
|
158 | + * added. |
|
159 | + * |
|
160 | + * The value returned MUST be percent-encoded, but MUST NOT double-encode |
|
161 | + * any characters. To determine what characters to encode, please refer to |
|
162 | + * RFC 3986, Sections 2 and 3.5. |
|
163 | + * |
|
164 | + * @see https://tools.ietf.org/html/rfc3986#section-2 |
|
165 | + * @see https://tools.ietf.org/html/rfc3986#section-3.5 |
|
166 | + * @return string The URI fragment. |
|
167 | + */ |
|
168 | + public function getFragment() : string; |
|
169 | + /** |
|
170 | + * Return an instance with the specified scheme. |
|
171 | + * |
|
172 | + * This method MUST retain the state of the current instance, and return |
|
173 | + * an instance that contains the specified scheme. |
|
174 | + * |
|
175 | + * Implementations MUST support the schemes "http" and "https" case |
|
176 | + * insensitively, and MAY accommodate other schemes if required. |
|
177 | + * |
|
178 | + * An empty scheme is equivalent to removing the scheme. |
|
179 | + * |
|
180 | + * @param string $scheme The scheme to use with the new instance. |
|
181 | + * @return static A new instance with the specified scheme. |
|
182 | + * @throws \InvalidArgumentException for invalid or unsupported schemes. |
|
183 | + */ |
|
184 | + public function withScheme(string $scheme) : UriInterface; |
|
185 | + /** |
|
186 | + * Return an instance with the specified user information. |
|
187 | + * |
|
188 | + * This method MUST retain the state of the current instance, and return |
|
189 | + * an instance that contains the specified user information. |
|
190 | + * |
|
191 | + * Password is optional, but the user information MUST include the |
|
192 | + * user; an empty string for the user is equivalent to removing user |
|
193 | + * information. |
|
194 | + * |
|
195 | + * @param string $user The user name to use for authority. |
|
196 | + * @param null|string $password The password associated with $user. |
|
197 | + * @return static A new instance with the specified user information. |
|
198 | + */ |
|
199 | + public function withUserInfo(string $user, ?string $password = null) : UriInterface; |
|
200 | + /** |
|
201 | + * Return an instance with the specified host. |
|
202 | + * |
|
203 | + * This method MUST retain the state of the current instance, and return |
|
204 | + * an instance that contains the specified host. |
|
205 | + * |
|
206 | + * An empty host value is equivalent to removing the host. |
|
207 | + * |
|
208 | + * @param string $host The hostname to use with the new instance. |
|
209 | + * @return static A new instance with the specified host. |
|
210 | + * @throws \InvalidArgumentException for invalid hostnames. |
|
211 | + */ |
|
212 | + public function withHost(string $host) : UriInterface; |
|
213 | + /** |
|
214 | + * Return an instance with the specified port. |
|
215 | + * |
|
216 | + * This method MUST retain the state of the current instance, and return |
|
217 | + * an instance that contains the specified port. |
|
218 | + * |
|
219 | + * Implementations MUST raise an exception for ports outside the |
|
220 | + * established TCP and UDP port ranges. |
|
221 | + * |
|
222 | + * A null value provided for the port is equivalent to removing the port |
|
223 | + * information. |
|
224 | + * |
|
225 | + * @param null|int $port The port to use with the new instance; a null value |
|
226 | + * removes the port information. |
|
227 | + * @return static A new instance with the specified port. |
|
228 | + * @throws \InvalidArgumentException for invalid ports. |
|
229 | + */ |
|
230 | + public function withPort(?int $port) : UriInterface; |
|
231 | + /** |
|
232 | + * Return an instance with the specified path. |
|
233 | + * |
|
234 | + * This method MUST retain the state of the current instance, and return |
|
235 | + * an instance that contains the specified path. |
|
236 | + * |
|
237 | + * The path can either be empty or absolute (starting with a slash) or |
|
238 | + * rootless (not starting with a slash). Implementations MUST support all |
|
239 | + * three syntaxes. |
|
240 | + * |
|
241 | + * If the path is intended to be domain-relative rather than path relative then |
|
242 | + * it must begin with a slash ("/"). Paths not starting with a slash ("/") |
|
243 | + * are assumed to be relative to some base path known to the application or |
|
244 | + * consumer. |
|
245 | + * |
|
246 | + * Users can provide both encoded and decoded path characters. |
|
247 | + * Implementations ensure the correct encoding as outlined in getPath(). |
|
248 | + * |
|
249 | + * @param string $path The path to use with the new instance. |
|
250 | + * @return static A new instance with the specified path. |
|
251 | + * @throws \InvalidArgumentException for invalid paths. |
|
252 | + */ |
|
253 | + public function withPath(string $path) : UriInterface; |
|
254 | + /** |
|
255 | + * Return an instance with the specified query string. |
|
256 | + * |
|
257 | + * This method MUST retain the state of the current instance, and return |
|
258 | + * an instance that contains the specified query string. |
|
259 | + * |
|
260 | + * Users can provide both encoded and decoded query characters. |
|
261 | + * Implementations ensure the correct encoding as outlined in getQuery(). |
|
262 | + * |
|
263 | + * An empty query string value is equivalent to removing the query string. |
|
264 | + * |
|
265 | + * @param string $query The query string to use with the new instance. |
|
266 | + * @return static A new instance with the specified query string. |
|
267 | + * @throws \InvalidArgumentException for invalid query strings. |
|
268 | + */ |
|
269 | + public function withQuery(string $query) : UriInterface; |
|
270 | + /** |
|
271 | + * Return an instance with the specified URI fragment. |
|
272 | + * |
|
273 | + * This method MUST retain the state of the current instance, and return |
|
274 | + * an instance that contains the specified URI fragment. |
|
275 | + * |
|
276 | + * Users can provide both encoded and decoded fragment characters. |
|
277 | + * Implementations ensure the correct encoding as outlined in getFragment(). |
|
278 | + * |
|
279 | + * An empty fragment value is equivalent to removing the fragment. |
|
280 | + * |
|
281 | + * @param string $fragment The fragment to use with the new instance. |
|
282 | + * @return static A new instance with the specified fragment. |
|
283 | + */ |
|
284 | + public function withFragment(string $fragment) : UriInterface; |
|
285 | + /** |
|
286 | + * Return the string representation as a URI reference. |
|
287 | + * |
|
288 | + * Depending on which components of the URI are present, the resulting |
|
289 | + * string is either a full URI or relative reference according to RFC 3986, |
|
290 | + * Section 4.1. The method concatenates the various components of the URI, |
|
291 | + * using the appropriate delimiters: |
|
292 | + * |
|
293 | + * - If a scheme is present, it MUST be suffixed by ":". |
|
294 | + * - If an authority is present, it MUST be prefixed by "//". |
|
295 | + * - The path can be concatenated without delimiters. But there are two |
|
296 | + * cases where the path has to be adjusted to make the URI reference |
|
297 | + * valid as PHP does not allow to throw an exception in __toString(): |
|
298 | + * - If the path is rootless and an authority is present, the path MUST |
|
299 | + * be prefixed by "/". |
|
300 | + * - If the path is starting with more than one "/" and no authority is |
|
301 | + * present, the starting slashes MUST be reduced to one. |
|
302 | + * - If a query is present, it MUST be prefixed by "?". |
|
303 | + * - If a fragment is present, it MUST be prefixed by "#". |
|
304 | + * |
|
305 | + * @see http://tools.ietf.org/html/rfc3986#section-4.1 |
|
306 | + * @return string |
|
307 | + */ |
|
308 | + public function __toString() : string; |
|
309 | 309 | } |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message; |
4 | 4 | |
5 | -interface StreamFactoryInterface |
|
6 | -{ |
|
5 | +interface StreamFactoryInterface { |
|
7 | 6 | /** |
8 | 7 | * Create a new stream from a string. |
9 | 8 | * |
@@ -4,40 +4,40 @@ |
||
4 | 4 | |
5 | 5 | interface StreamFactoryInterface |
6 | 6 | { |
7 | - /** |
|
8 | - * Create a new stream from a string. |
|
9 | - * |
|
10 | - * The stream SHOULD be created with a temporary resource. |
|
11 | - * |
|
12 | - * @param string $content String content with which to populate the stream. |
|
13 | - * |
|
14 | - * @return StreamInterface |
|
15 | - */ |
|
16 | - public function createStream(string $content = '') : StreamInterface; |
|
17 | - /** |
|
18 | - * Create a stream from an existing file. |
|
19 | - * |
|
20 | - * The file MUST be opened using the given mode, which may be any mode |
|
21 | - * supported by the `fopen` function. |
|
22 | - * |
|
23 | - * The `$filename` MAY be any string supported by `fopen()`. |
|
24 | - * |
|
25 | - * @param string $filename Filename or stream URI to use as basis of stream. |
|
26 | - * @param string $mode Mode with which to open the underlying filename/stream. |
|
27 | - * |
|
28 | - * @return StreamInterface |
|
29 | - * @throws \RuntimeException If the file cannot be opened. |
|
30 | - * @throws \InvalidArgumentException If the mode is invalid. |
|
31 | - */ |
|
32 | - public function createStreamFromFile(string $filename, string $mode = 'r') : StreamInterface; |
|
33 | - /** |
|
34 | - * Create a new stream from an existing resource. |
|
35 | - * |
|
36 | - * The stream MUST be readable and may be writable. |
|
37 | - * |
|
38 | - * @param resource $resource PHP resource to use as basis of stream. |
|
39 | - * |
|
40 | - * @return StreamInterface |
|
41 | - */ |
|
42 | - public function createStreamFromResource($resource) : StreamInterface; |
|
7 | + /** |
|
8 | + * Create a new stream from a string. |
|
9 | + * |
|
10 | + * The stream SHOULD be created with a temporary resource. |
|
11 | + * |
|
12 | + * @param string $content String content with which to populate the stream. |
|
13 | + * |
|
14 | + * @return StreamInterface |
|
15 | + */ |
|
16 | + public function createStream(string $content = '') : StreamInterface; |
|
17 | + /** |
|
18 | + * Create a stream from an existing file. |
|
19 | + * |
|
20 | + * The file MUST be opened using the given mode, which may be any mode |
|
21 | + * supported by the `fopen` function. |
|
22 | + * |
|
23 | + * The `$filename` MAY be any string supported by `fopen()`. |
|
24 | + * |
|
25 | + * @param string $filename Filename or stream URI to use as basis of stream. |
|
26 | + * @param string $mode Mode with which to open the underlying filename/stream. |
|
27 | + * |
|
28 | + * @return StreamInterface |
|
29 | + * @throws \RuntimeException If the file cannot be opened. |
|
30 | + * @throws \InvalidArgumentException If the mode is invalid. |
|
31 | + */ |
|
32 | + public function createStreamFromFile(string $filename, string $mode = 'r') : StreamInterface; |
|
33 | + /** |
|
34 | + * Create a new stream from an existing resource. |
|
35 | + * |
|
36 | + * The stream MUST be readable and may be writable. |
|
37 | + * |
|
38 | + * @param resource $resource PHP resource to use as basis of stream. |
|
39 | + * |
|
40 | + * @return StreamInterface |
|
41 | + */ |
|
42 | + public function createStreamFromResource($resource) : StreamInterface; |
|
43 | 43 | } |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message; |
4 | 4 | |
5 | -interface UploadedFileFactoryInterface |
|
6 | -{ |
|
5 | +interface UploadedFileFactoryInterface { |
|
7 | 6 | /** |
8 | 7 | * Create a new uploaded file. |
9 | 8 | * |
@@ -4,25 +4,25 @@ |
||
4 | 4 | |
5 | 5 | interface UploadedFileFactoryInterface |
6 | 6 | { |
7 | - /** |
|
8 | - * Create a new uploaded file. |
|
9 | - * |
|
10 | - * If a size is not provided it will be determined by checking the size of |
|
11 | - * the file. |
|
12 | - * |
|
13 | - * @see http://php.net/manual/features.file-upload.post-method.php |
|
14 | - * @see http://php.net/manual/features.file-upload.errors.php |
|
15 | - * |
|
16 | - * @param StreamInterface $stream Underlying stream representing the |
|
17 | - * uploaded file content. |
|
18 | - * @param int $size in bytes |
|
19 | - * @param int $error PHP file upload error |
|
20 | - * @param string $clientFilename Filename as provided by the client, if any. |
|
21 | - * @param string $clientMediaType Media type as provided by the client, if any. |
|
22 | - * |
|
23 | - * @return UploadedFileInterface |
|
24 | - * |
|
25 | - * @throws \InvalidArgumentException If the file resource is not readable. |
|
26 | - */ |
|
27 | - public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null) : UploadedFileInterface; |
|
7 | + /** |
|
8 | + * Create a new uploaded file. |
|
9 | + * |
|
10 | + * If a size is not provided it will be determined by checking the size of |
|
11 | + * the file. |
|
12 | + * |
|
13 | + * @see http://php.net/manual/features.file-upload.post-method.php |
|
14 | + * @see http://php.net/manual/features.file-upload.errors.php |
|
15 | + * |
|
16 | + * @param StreamInterface $stream Underlying stream representing the |
|
17 | + * uploaded file content. |
|
18 | + * @param int $size in bytes |
|
19 | + * @param int $error PHP file upload error |
|
20 | + * @param string $clientFilename Filename as provided by the client, if any. |
|
21 | + * @param string $clientMediaType Media type as provided by the client, if any. |
|
22 | + * |
|
23 | + * @return UploadedFileInterface |
|
24 | + * |
|
25 | + * @throws \InvalidArgumentException If the file resource is not readable. |
|
26 | + */ |
|
27 | + public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null) : UploadedFileInterface; |
|
28 | 28 | } |
@@ -14,8 +14,7 @@ |
||
14 | 14 | * @link http://www.ietf.org/rfc/rfc7230.txt |
15 | 15 | * @link http://www.ietf.org/rfc/rfc7231.txt |
16 | 16 | */ |
17 | -interface MessageInterface |
|
18 | -{ |
|
17 | +interface MessageInterface { |
|
19 | 18 | /** |
20 | 19 | * Retrieves the HTTP protocol version as a string. |
21 | 20 | * |
@@ -16,162 +16,162 @@ |
||
16 | 16 | */ |
17 | 17 | interface MessageInterface |
18 | 18 | { |
19 | - /** |
|
20 | - * Retrieves the HTTP protocol version as a string. |
|
21 | - * |
|
22 | - * The string MUST contain only the HTTP version number (e.g., "1.1", "1.0"). |
|
23 | - * |
|
24 | - * @return string HTTP protocol version. |
|
25 | - */ |
|
26 | - public function getProtocolVersion() : string; |
|
27 | - /** |
|
28 | - * Return an instance with the specified HTTP protocol version. |
|
29 | - * |
|
30 | - * The version string MUST contain only the HTTP version number (e.g., |
|
31 | - * "1.1", "1.0"). |
|
32 | - * |
|
33 | - * This method MUST be implemented in such a way as to retain the |
|
34 | - * immutability of the message, and MUST return an instance that has the |
|
35 | - * new protocol version. |
|
36 | - * |
|
37 | - * @param string $version HTTP protocol version |
|
38 | - * @return static |
|
39 | - */ |
|
40 | - public function withProtocolVersion(string $version) : MessageInterface; |
|
41 | - /** |
|
42 | - * Retrieves all message header values. |
|
43 | - * |
|
44 | - * The keys represent the header name as it will be sent over the wire, and |
|
45 | - * each value is an array of strings associated with the header. |
|
46 | - * |
|
47 | - * // Represent the headers as a string |
|
48 | - * foreach ($message->getHeaders() as $name => $values) { |
|
49 | - * echo $name . ": " . implode(", ", $values); |
|
50 | - * } |
|
51 | - * |
|
52 | - * // Emit headers iteratively: |
|
53 | - * foreach ($message->getHeaders() as $name => $values) { |
|
54 | - * foreach ($values as $value) { |
|
55 | - * header(sprintf('%s: %s', $name, $value), false); |
|
56 | - * } |
|
57 | - * } |
|
58 | - * |
|
59 | - * While header names are not case-sensitive, getHeaders() will preserve the |
|
60 | - * exact case in which headers were originally specified. |
|
61 | - * |
|
62 | - * @return string[][] Returns an associative array of the message's headers. Each |
|
63 | - * key MUST be a header name, and each value MUST be an array of strings |
|
64 | - * for that header. |
|
65 | - */ |
|
66 | - public function getHeaders() : array; |
|
67 | - /** |
|
68 | - * Checks if a header exists by the given case-insensitive name. |
|
69 | - * |
|
70 | - * @param string $name Case-insensitive header field name. |
|
71 | - * @return bool Returns true if any header names match the given header |
|
72 | - * name using a case-insensitive string comparison. Returns false if |
|
73 | - * no matching header name is found in the message. |
|
74 | - */ |
|
75 | - public function hasHeader(string $name) : bool; |
|
76 | - /** |
|
77 | - * Retrieves a message header value by the given case-insensitive name. |
|
78 | - * |
|
79 | - * This method returns an array of all the header values of the given |
|
80 | - * case-insensitive header name. |
|
81 | - * |
|
82 | - * If the header does not appear in the message, this method MUST return an |
|
83 | - * empty array. |
|
84 | - * |
|
85 | - * @param string $name Case-insensitive header field name. |
|
86 | - * @return string[] An array of string values as provided for the given |
|
87 | - * header. If the header does not appear in the message, this method MUST |
|
88 | - * return an empty array. |
|
89 | - */ |
|
90 | - public function getHeader(string $name) : array; |
|
91 | - /** |
|
92 | - * Retrieves a comma-separated string of the values for a single header. |
|
93 | - * |
|
94 | - * This method returns all of the header values of the given |
|
95 | - * case-insensitive header name as a string concatenated together using |
|
96 | - * a comma. |
|
97 | - * |
|
98 | - * NOTE: Not all header values may be appropriately represented using |
|
99 | - * comma concatenation. For such headers, use getHeader() instead |
|
100 | - * and supply your own delimiter when concatenating. |
|
101 | - * |
|
102 | - * If the header does not appear in the message, this method MUST return |
|
103 | - * an empty string. |
|
104 | - * |
|
105 | - * @param string $name Case-insensitive header field name. |
|
106 | - * @return string A string of values as provided for the given header |
|
107 | - * concatenated together using a comma. If the header does not appear in |
|
108 | - * the message, this method MUST return an empty string. |
|
109 | - */ |
|
110 | - public function getHeaderLine(string $name) : string; |
|
111 | - /** |
|
112 | - * Return an instance with the provided value replacing the specified header. |
|
113 | - * |
|
114 | - * While header names are case-insensitive, the casing of the header will |
|
115 | - * be preserved by this function, and returned from getHeaders(). |
|
116 | - * |
|
117 | - * This method MUST be implemented in such a way as to retain the |
|
118 | - * immutability of the message, and MUST return an instance that has the |
|
119 | - * new and/or updated header and value. |
|
120 | - * |
|
121 | - * @param string $name Case-insensitive header field name. |
|
122 | - * @param string|string[] $value Header value(s). |
|
123 | - * @return static |
|
124 | - * @throws \InvalidArgumentException for invalid header names or values. |
|
125 | - */ |
|
126 | - public function withHeader(string $name, $value) : MessageInterface; |
|
127 | - /** |
|
128 | - * Return an instance with the specified header appended with the given value. |
|
129 | - * |
|
130 | - * Existing values for the specified header will be maintained. The new |
|
131 | - * value(s) will be appended to the existing list. If the header did not |
|
132 | - * exist previously, it will be added. |
|
133 | - * |
|
134 | - * This method MUST be implemented in such a way as to retain the |
|
135 | - * immutability of the message, and MUST return an instance that has the |
|
136 | - * new header and/or value. |
|
137 | - * |
|
138 | - * @param string $name Case-insensitive header field name to add. |
|
139 | - * @param string|string[] $value Header value(s). |
|
140 | - * @return static |
|
141 | - * @throws \InvalidArgumentException for invalid header names or values. |
|
142 | - */ |
|
143 | - public function withAddedHeader(string $name, $value) : MessageInterface; |
|
144 | - /** |
|
145 | - * Return an instance without the specified header. |
|
146 | - * |
|
147 | - * Header resolution MUST be done without case-sensitivity. |
|
148 | - * |
|
149 | - * This method MUST be implemented in such a way as to retain the |
|
150 | - * immutability of the message, and MUST return an instance that removes |
|
151 | - * the named header. |
|
152 | - * |
|
153 | - * @param string $name Case-insensitive header field name to remove. |
|
154 | - * @return static |
|
155 | - */ |
|
156 | - public function withoutHeader(string $name) : MessageInterface; |
|
157 | - /** |
|
158 | - * Gets the body of the message. |
|
159 | - * |
|
160 | - * @return StreamInterface Returns the body as a stream. |
|
161 | - */ |
|
162 | - public function getBody() : StreamInterface; |
|
163 | - /** |
|
164 | - * Return an instance with the specified message body. |
|
165 | - * |
|
166 | - * The body MUST be a StreamInterface object. |
|
167 | - * |
|
168 | - * This method MUST be implemented in such a way as to retain the |
|
169 | - * immutability of the message, and MUST return a new instance that has the |
|
170 | - * new body stream. |
|
171 | - * |
|
172 | - * @param StreamInterface $body Body. |
|
173 | - * @return static |
|
174 | - * @throws \InvalidArgumentException When the body is not valid. |
|
175 | - */ |
|
176 | - public function withBody(StreamInterface $body) : MessageInterface; |
|
19 | + /** |
|
20 | + * Retrieves the HTTP protocol version as a string. |
|
21 | + * |
|
22 | + * The string MUST contain only the HTTP version number (e.g., "1.1", "1.0"). |
|
23 | + * |
|
24 | + * @return string HTTP protocol version. |
|
25 | + */ |
|
26 | + public function getProtocolVersion() : string; |
|
27 | + /** |
|
28 | + * Return an instance with the specified HTTP protocol version. |
|
29 | + * |
|
30 | + * The version string MUST contain only the HTTP version number (e.g., |
|
31 | + * "1.1", "1.0"). |
|
32 | + * |
|
33 | + * This method MUST be implemented in such a way as to retain the |
|
34 | + * immutability of the message, and MUST return an instance that has the |
|
35 | + * new protocol version. |
|
36 | + * |
|
37 | + * @param string $version HTTP protocol version |
|
38 | + * @return static |
|
39 | + */ |
|
40 | + public function withProtocolVersion(string $version) : MessageInterface; |
|
41 | + /** |
|
42 | + * Retrieves all message header values. |
|
43 | + * |
|
44 | + * The keys represent the header name as it will be sent over the wire, and |
|
45 | + * each value is an array of strings associated with the header. |
|
46 | + * |
|
47 | + * // Represent the headers as a string |
|
48 | + * foreach ($message->getHeaders() as $name => $values) { |
|
49 | + * echo $name . ": " . implode(", ", $values); |
|
50 | + * } |
|
51 | + * |
|
52 | + * // Emit headers iteratively: |
|
53 | + * foreach ($message->getHeaders() as $name => $values) { |
|
54 | + * foreach ($values as $value) { |
|
55 | + * header(sprintf('%s: %s', $name, $value), false); |
|
56 | + * } |
|
57 | + * } |
|
58 | + * |
|
59 | + * While header names are not case-sensitive, getHeaders() will preserve the |
|
60 | + * exact case in which headers were originally specified. |
|
61 | + * |
|
62 | + * @return string[][] Returns an associative array of the message's headers. Each |
|
63 | + * key MUST be a header name, and each value MUST be an array of strings |
|
64 | + * for that header. |
|
65 | + */ |
|
66 | + public function getHeaders() : array; |
|
67 | + /** |
|
68 | + * Checks if a header exists by the given case-insensitive name. |
|
69 | + * |
|
70 | + * @param string $name Case-insensitive header field name. |
|
71 | + * @return bool Returns true if any header names match the given header |
|
72 | + * name using a case-insensitive string comparison. Returns false if |
|
73 | + * no matching header name is found in the message. |
|
74 | + */ |
|
75 | + public function hasHeader(string $name) : bool; |
|
76 | + /** |
|
77 | + * Retrieves a message header value by the given case-insensitive name. |
|
78 | + * |
|
79 | + * This method returns an array of all the header values of the given |
|
80 | + * case-insensitive header name. |
|
81 | + * |
|
82 | + * If the header does not appear in the message, this method MUST return an |
|
83 | + * empty array. |
|
84 | + * |
|
85 | + * @param string $name Case-insensitive header field name. |
|
86 | + * @return string[] An array of string values as provided for the given |
|
87 | + * header. If the header does not appear in the message, this method MUST |
|
88 | + * return an empty array. |
|
89 | + */ |
|
90 | + public function getHeader(string $name) : array; |
|
91 | + /** |
|
92 | + * Retrieves a comma-separated string of the values for a single header. |
|
93 | + * |
|
94 | + * This method returns all of the header values of the given |
|
95 | + * case-insensitive header name as a string concatenated together using |
|
96 | + * a comma. |
|
97 | + * |
|
98 | + * NOTE: Not all header values may be appropriately represented using |
|
99 | + * comma concatenation. For such headers, use getHeader() instead |
|
100 | + * and supply your own delimiter when concatenating. |
|
101 | + * |
|
102 | + * If the header does not appear in the message, this method MUST return |
|
103 | + * an empty string. |
|
104 | + * |
|
105 | + * @param string $name Case-insensitive header field name. |
|
106 | + * @return string A string of values as provided for the given header |
|
107 | + * concatenated together using a comma. If the header does not appear in |
|
108 | + * the message, this method MUST return an empty string. |
|
109 | + */ |
|
110 | + public function getHeaderLine(string $name) : string; |
|
111 | + /** |
|
112 | + * Return an instance with the provided value replacing the specified header. |
|
113 | + * |
|
114 | + * While header names are case-insensitive, the casing of the header will |
|
115 | + * be preserved by this function, and returned from getHeaders(). |
|
116 | + * |
|
117 | + * This method MUST be implemented in such a way as to retain the |
|
118 | + * immutability of the message, and MUST return an instance that has the |
|
119 | + * new and/or updated header and value. |
|
120 | + * |
|
121 | + * @param string $name Case-insensitive header field name. |
|
122 | + * @param string|string[] $value Header value(s). |
|
123 | + * @return static |
|
124 | + * @throws \InvalidArgumentException for invalid header names or values. |
|
125 | + */ |
|
126 | + public function withHeader(string $name, $value) : MessageInterface; |
|
127 | + /** |
|
128 | + * Return an instance with the specified header appended with the given value. |
|
129 | + * |
|
130 | + * Existing values for the specified header will be maintained. The new |
|
131 | + * value(s) will be appended to the existing list. If the header did not |
|
132 | + * exist previously, it will be added. |
|
133 | + * |
|
134 | + * This method MUST be implemented in such a way as to retain the |
|
135 | + * immutability of the message, and MUST return an instance that has the |
|
136 | + * new header and/or value. |
|
137 | + * |
|
138 | + * @param string $name Case-insensitive header field name to add. |
|
139 | + * @param string|string[] $value Header value(s). |
|
140 | + * @return static |
|
141 | + * @throws \InvalidArgumentException for invalid header names or values. |
|
142 | + */ |
|
143 | + public function withAddedHeader(string $name, $value) : MessageInterface; |
|
144 | + /** |
|
145 | + * Return an instance without the specified header. |
|
146 | + * |
|
147 | + * Header resolution MUST be done without case-sensitivity. |
|
148 | + * |
|
149 | + * This method MUST be implemented in such a way as to retain the |
|
150 | + * immutability of the message, and MUST return an instance that removes |
|
151 | + * the named header. |
|
152 | + * |
|
153 | + * @param string $name Case-insensitive header field name to remove. |
|
154 | + * @return static |
|
155 | + */ |
|
156 | + public function withoutHeader(string $name) : MessageInterface; |
|
157 | + /** |
|
158 | + * Gets the body of the message. |
|
159 | + * |
|
160 | + * @return StreamInterface Returns the body as a stream. |
|
161 | + */ |
|
162 | + public function getBody() : StreamInterface; |
|
163 | + /** |
|
164 | + * Return an instance with the specified message body. |
|
165 | + * |
|
166 | + * The body MUST be a StreamInterface object. |
|
167 | + * |
|
168 | + * This method MUST be implemented in such a way as to retain the |
|
169 | + * immutability of the message, and MUST return a new instance that has the |
|
170 | + * new body stream. |
|
171 | + * |
|
172 | + * @param StreamInterface $body Body. |
|
173 | + * @return static |
|
174 | + * @throws \InvalidArgumentException When the body is not valid. |
|
175 | + */ |
|
176 | + public function withBody(StreamInterface $body) : MessageInterface; |
|
177 | 177 | } |
@@ -21,8 +21,7 @@ |
||
21 | 21 | * be implemented such that they retain the internal state of the current |
22 | 22 | * message and return an instance that contains the changed state. |
23 | 23 | */ |
24 | -interface RequestInterface extends MessageInterface |
|
25 | -{ |
|
24 | +interface RequestInterface extends MessageInterface { |
|
26 | 25 | /** |
27 | 26 | * Retrieves the message's request target. |
28 | 27 | * |
@@ -23,102 +23,102 @@ |
||
23 | 23 | */ |
24 | 24 | interface RequestInterface extends MessageInterface |
25 | 25 | { |
26 | - /** |
|
27 | - * Retrieves the message's request target. |
|
28 | - * |
|
29 | - * Retrieves the message's request-target either as it will appear (for |
|
30 | - * clients), as it appeared at request (for servers), or as it was |
|
31 | - * specified for the instance (see withRequestTarget()). |
|
32 | - * |
|
33 | - * In most cases, this will be the origin-form of the composed URI, |
|
34 | - * unless a value was provided to the concrete implementation (see |
|
35 | - * withRequestTarget() below). |
|
36 | - * |
|
37 | - * If no URI is available, and no request-target has been specifically |
|
38 | - * provided, this method MUST return the string "/". |
|
39 | - * |
|
40 | - * @return string |
|
41 | - */ |
|
42 | - public function getRequestTarget() : string; |
|
43 | - /** |
|
44 | - * Return an instance with the specific request-target. |
|
45 | - * |
|
46 | - * If the request needs a non-origin-form request-target — e.g., for |
|
47 | - * specifying an absolute-form, authority-form, or asterisk-form — |
|
48 | - * this method may be used to create an instance with the specified |
|
49 | - * request-target, verbatim. |
|
50 | - * |
|
51 | - * This method MUST be implemented in such a way as to retain the |
|
52 | - * immutability of the message, and MUST return an instance that has the |
|
53 | - * changed request target. |
|
54 | - * |
|
55 | - * @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various |
|
56 | - * request-target forms allowed in request messages) |
|
57 | - * @param string $requestTarget |
|
58 | - * @return static |
|
59 | - */ |
|
60 | - public function withRequestTarget(string $requestTarget) : RequestInterface; |
|
61 | - /** |
|
62 | - * Retrieves the HTTP method of the request. |
|
63 | - * |
|
64 | - * @return string Returns the request method. |
|
65 | - */ |
|
66 | - public function getMethod() : string; |
|
67 | - /** |
|
68 | - * Return an instance with the provided HTTP method. |
|
69 | - * |
|
70 | - * While HTTP method names are typically all uppercase characters, HTTP |
|
71 | - * method names are case-sensitive and thus implementations SHOULD NOT |
|
72 | - * modify the given string. |
|
73 | - * |
|
74 | - * This method MUST be implemented in such a way as to retain the |
|
75 | - * immutability of the message, and MUST return an instance that has the |
|
76 | - * changed request method. |
|
77 | - * |
|
78 | - * @param string $method Case-sensitive method. |
|
79 | - * @return static |
|
80 | - * @throws \InvalidArgumentException for invalid HTTP methods. |
|
81 | - */ |
|
82 | - public function withMethod(string $method) : RequestInterface; |
|
83 | - /** |
|
84 | - * Retrieves the URI instance. |
|
85 | - * |
|
86 | - * This method MUST return a UriInterface instance. |
|
87 | - * |
|
88 | - * @link http://tools.ietf.org/html/rfc3986#section-4.3 |
|
89 | - * @return UriInterface Returns a UriInterface instance |
|
90 | - * representing the URI of the request. |
|
91 | - */ |
|
92 | - public function getUri() : UriInterface; |
|
93 | - /** |
|
94 | - * Returns an instance with the provided URI. |
|
95 | - * |
|
96 | - * This method MUST update the Host header of the returned request by |
|
97 | - * default if the URI contains a host component. If the URI does not |
|
98 | - * contain a host component, any pre-existing Host header MUST be carried |
|
99 | - * over to the returned request. |
|
100 | - * |
|
101 | - * You can opt-in to preserving the original state of the Host header by |
|
102 | - * setting `$preserveHost` to `true`. When `$preserveHost` is set to |
|
103 | - * `true`, this method interacts with the Host header in the following ways: |
|
104 | - * |
|
105 | - * - If the Host header is missing or empty, and the new URI contains |
|
106 | - * a host component, this method MUST update the Host header in the returned |
|
107 | - * request. |
|
108 | - * - If the Host header is missing or empty, and the new URI does not contain a |
|
109 | - * host component, this method MUST NOT update the Host header in the returned |
|
110 | - * request. |
|
111 | - * - If a Host header is present and non-empty, this method MUST NOT update |
|
112 | - * the Host header in the returned request. |
|
113 | - * |
|
114 | - * This method MUST be implemented in such a way as to retain the |
|
115 | - * immutability of the message, and MUST return an instance that has the |
|
116 | - * new UriInterface instance. |
|
117 | - * |
|
118 | - * @link http://tools.ietf.org/html/rfc3986#section-4.3 |
|
119 | - * @param UriInterface $uri New request URI to use. |
|
120 | - * @param bool $preserveHost Preserve the original state of the Host header. |
|
121 | - * @return static |
|
122 | - */ |
|
123 | - public function withUri(UriInterface $uri, bool $preserveHost = \false) : RequestInterface; |
|
26 | + /** |
|
27 | + * Retrieves the message's request target. |
|
28 | + * |
|
29 | + * Retrieves the message's request-target either as it will appear (for |
|
30 | + * clients), as it appeared at request (for servers), or as it was |
|
31 | + * specified for the instance (see withRequestTarget()). |
|
32 | + * |
|
33 | + * In most cases, this will be the origin-form of the composed URI, |
|
34 | + * unless a value was provided to the concrete implementation (see |
|
35 | + * withRequestTarget() below). |
|
36 | + * |
|
37 | + * If no URI is available, and no request-target has been specifically |
|
38 | + * provided, this method MUST return the string "/". |
|
39 | + * |
|
40 | + * @return string |
|
41 | + */ |
|
42 | + public function getRequestTarget() : string; |
|
43 | + /** |
|
44 | + * Return an instance with the specific request-target. |
|
45 | + * |
|
46 | + * If the request needs a non-origin-form request-target — e.g., for |
|
47 | + * specifying an absolute-form, authority-form, or asterisk-form — |
|
48 | + * this method may be used to create an instance with the specified |
|
49 | + * request-target, verbatim. |
|
50 | + * |
|
51 | + * This method MUST be implemented in such a way as to retain the |
|
52 | + * immutability of the message, and MUST return an instance that has the |
|
53 | + * changed request target. |
|
54 | + * |
|
55 | + * @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various |
|
56 | + * request-target forms allowed in request messages) |
|
57 | + * @param string $requestTarget |
|
58 | + * @return static |
|
59 | + */ |
|
60 | + public function withRequestTarget(string $requestTarget) : RequestInterface; |
|
61 | + /** |
|
62 | + * Retrieves the HTTP method of the request. |
|
63 | + * |
|
64 | + * @return string Returns the request method. |
|
65 | + */ |
|
66 | + public function getMethod() : string; |
|
67 | + /** |
|
68 | + * Return an instance with the provided HTTP method. |
|
69 | + * |
|
70 | + * While HTTP method names are typically all uppercase characters, HTTP |
|
71 | + * method names are case-sensitive and thus implementations SHOULD NOT |
|
72 | + * modify the given string. |
|
73 | + * |
|
74 | + * This method MUST be implemented in such a way as to retain the |
|
75 | + * immutability of the message, and MUST return an instance that has the |
|
76 | + * changed request method. |
|
77 | + * |
|
78 | + * @param string $method Case-sensitive method. |
|
79 | + * @return static |
|
80 | + * @throws \InvalidArgumentException for invalid HTTP methods. |
|
81 | + */ |
|
82 | + public function withMethod(string $method) : RequestInterface; |
|
83 | + /** |
|
84 | + * Retrieves the URI instance. |
|
85 | + * |
|
86 | + * This method MUST return a UriInterface instance. |
|
87 | + * |
|
88 | + * @link http://tools.ietf.org/html/rfc3986#section-4.3 |
|
89 | + * @return UriInterface Returns a UriInterface instance |
|
90 | + * representing the URI of the request. |
|
91 | + */ |
|
92 | + public function getUri() : UriInterface; |
|
93 | + /** |
|
94 | + * Returns an instance with the provided URI. |
|
95 | + * |
|
96 | + * This method MUST update the Host header of the returned request by |
|
97 | + * default if the URI contains a host component. If the URI does not |
|
98 | + * contain a host component, any pre-existing Host header MUST be carried |
|
99 | + * over to the returned request. |
|
100 | + * |
|
101 | + * You can opt-in to preserving the original state of the Host header by |
|
102 | + * setting `$preserveHost` to `true`. When `$preserveHost` is set to |
|
103 | + * `true`, this method interacts with the Host header in the following ways: |
|
104 | + * |
|
105 | + * - If the Host header is missing or empty, and the new URI contains |
|
106 | + * a host component, this method MUST update the Host header in the returned |
|
107 | + * request. |
|
108 | + * - If the Host header is missing or empty, and the new URI does not contain a |
|
109 | + * host component, this method MUST NOT update the Host header in the returned |
|
110 | + * request. |
|
111 | + * - If a Host header is present and non-empty, this method MUST NOT update |
|
112 | + * the Host header in the returned request. |
|
113 | + * |
|
114 | + * This method MUST be implemented in such a way as to retain the |
|
115 | + * immutability of the message, and MUST return an instance that has the |
|
116 | + * new UriInterface instance. |
|
117 | + * |
|
118 | + * @link http://tools.ietf.org/html/rfc3986#section-4.3 |
|
119 | + * @param UriInterface $uri New request URI to use. |
|
120 | + * @param bool $preserveHost Preserve the original state of the Host header. |
|
121 | + * @return static |
|
122 | + */ |
|
123 | + public function withUri(UriInterface $uri, bool $preserveHost = \false) : RequestInterface; |
|
124 | 124 | } |