Skip to content

Commit 531815e

Browse files
committed
Bump psr/http-message version
1 parent 694016e commit 531815e

File tree

5 files changed

+25
-28
lines changed

5 files changed

+25
-28
lines changed

Tests/Fixtures/Message.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getProtocolVersion(): string
4242
*
4343
* @return static
4444
*/
45-
public function withProtocolVersion($version)
45+
public function withProtocolVersion($version): MessageInterface
4646
{
4747
throw new \BadMethodCallException('Not implemented.');
4848
}
@@ -72,7 +72,7 @@ public function getHeaderLine($name): string
7272
*
7373
* @return static
7474
*/
75-
public function withHeader($name, $value)
75+
public function withHeader($name, $value): MessageInterface
7676
{
7777
$this->headers[$name] = (array) $value;
7878

@@ -84,7 +84,7 @@ public function withHeader($name, $value)
8484
*
8585
* @return static
8686
*/
87-
public function withAddedHeader($name, $value)
87+
public function withAddedHeader($name, $value): MessageInterface
8888
{
8989
throw new \BadMethodCallException('Not implemented.');
9090
}
@@ -94,7 +94,7 @@ public function withAddedHeader($name, $value)
9494
*
9595
* @return static
9696
*/
97-
public function withoutHeader($name)
97+
public function withoutHeader($name): MessageInterface
9898
{
9999
unset($this->headers[$name]);
100100

@@ -111,7 +111,7 @@ public function getBody(): StreamInterface
111111
*
112112
* @return static
113113
*/
114-
public function withBody(StreamInterface $body)
114+
public function withBody(StreamInterface $body): MessageInterface
115115
{
116116
throw new \BadMethodCallException('Not implemented.');
117117
}

Tests/Fixtures/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getStatusCode(): int
3636
/**
3737
* @return static
3838
*/
39-
public function withStatus($code, $reasonPhrase = '')
39+
public function withStatus($code, $reasonPhrase = ''): ResponseInterface
4040
{
4141
throw new \BadMethodCallException('Not implemented.');
4242
}

Tests/Fixtures/ServerRequest.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Psr\Http\Message\ServerRequestInterface;
1515
use Psr\Http\Message\StreamInterface;
16+
use Psr\Http\Message\RequestInterface;
1617
use Psr\Http\Message\UriInterface;
1718

1819
/**
@@ -52,10 +53,8 @@ public function getRequestTarget(): string
5253

5354
/**
5455
* {@inheritdoc}
55-
*
56-
* @return static
5756
*/
58-
public function withRequestTarget($requestTarget)
57+
public function withRequestTarget($requestTarget): RequestInterface
5958
{
6059
throw new \BadMethodCallException('Not implemented.');
6160
}
@@ -70,17 +69,15 @@ public function getMethod(): string
7069
*
7170
* @return static
7271
*/
73-
public function withMethod($method)
72+
public function withMethod($method): ServerRequestInterface
7473
{
7574
throw new \BadMethodCallException('Not implemented.');
7675
}
7776

7877
/**
7978
* {@inheritdoc}
80-
*
81-
* @return UriInterface
8279
*/
83-
public function getUri()
80+
public function getUri(): UriInterface
8481
{
8582
return $this->uri;
8683
}
@@ -90,7 +87,7 @@ public function getUri()
9087
*
9188
* @return static
9289
*/
93-
public function withUri(UriInterface $uri, $preserveHost = false)
90+
public function withUri(UriInterface $uri, $preserveHost = false): ServerRequestInterface
9491
{
9592
throw new \BadMethodCallException('Not implemented.');
9693
}
@@ -110,7 +107,7 @@ public function getCookieParams(): array
110107
*
111108
* @return static
112109
*/
113-
public function withCookieParams(array $cookies)
110+
public function withCookieParams(array $cookies): ServerRequestInterface
114111
{
115112
throw new \BadMethodCallException('Not implemented.');
116113
}
@@ -125,7 +122,7 @@ public function getQueryParams(): array
125122
*
126123
* @return static
127124
*/
128-
public function withQueryParams(array $query)
125+
public function withQueryParams(array $query): ServerRequestInterface
129126
{
130127
throw new \BadMethodCallException('Not implemented.');
131128
}
@@ -140,7 +137,7 @@ public function getUploadedFiles(): array
140137
*
141138
* @return static
142139
*/
143-
public function withUploadedFiles(array $uploadedFiles)
140+
public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface
144141
{
145142
throw new \BadMethodCallException('Not implemented.');
146143
}
@@ -160,7 +157,7 @@ public function getParsedBody()
160157
*
161158
* @return static
162159
*/
163-
public function withParsedBody($data)
160+
public function withParsedBody($data): ServerRequestInterface
164161
{
165162
throw new \BadMethodCallException('Not implemented.');
166163
}
@@ -185,7 +182,7 @@ public function getAttribute($name, $default = null)
185182
*
186183
* @return static
187184
*/
188-
public function withAttribute($name, $value)
185+
public function withAttribute($name, $value): ServerRequestInterface
189186
{
190187
throw new \BadMethodCallException('Not implemented.');
191188
}
@@ -195,7 +192,7 @@ public function withAttribute($name, $value)
195192
*
196193
* @return static
197194
*/
198-
public function withoutAttribute($name)
195+
public function withoutAttribute($name): ServerRequestInterface
199196
{
200197
throw new \BadMethodCallException('Not implemented.');
201198
}

Tests/Fixtures/Uri.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getFragment(): string
9898
*
9999
* @return static
100100
*/
101-
public function withScheme($scheme)
101+
public function withScheme($scheme): UriInterface
102102
{
103103
throw new \BadMethodCallException('Not implemented.');
104104
}
@@ -108,7 +108,7 @@ public function withScheme($scheme)
108108
*
109109
* @return static
110110
*/
111-
public function withUserInfo($user, $password = null)
111+
public function withUserInfo($user, $password = null): UriInterface
112112
{
113113
throw new \BadMethodCallException('Not implemented.');
114114
}
@@ -118,7 +118,7 @@ public function withUserInfo($user, $password = null)
118118
*
119119
* @return static
120120
*/
121-
public function withHost($host)
121+
public function withHost($host): UriInterface
122122
{
123123
throw new \BadMethodCallException('Not implemented.');
124124
}
@@ -128,7 +128,7 @@ public function withHost($host)
128128
*
129129
* @return static
130130
*/
131-
public function withPort($port)
131+
public function withPort($port): UriInterface
132132
{
133133
throw new \BadMethodCallException('Not implemented.');
134134
}
@@ -138,7 +138,7 @@ public function withPort($port)
138138
*
139139
* @return static
140140
*/
141-
public function withPath($path)
141+
public function withPath($path): UriInterface
142142
{
143143
throw new \BadMethodCallException('Not implemented.');
144144
}
@@ -148,7 +148,7 @@ public function withPath($path)
148148
*
149149
* @return static
150150
*/
151-
public function withQuery($query)
151+
public function withQuery($query): UriInterface
152152
{
153153
throw new \BadMethodCallException('Not implemented.');
154154
}
@@ -158,7 +158,7 @@ public function withQuery($query)
158158
*
159159
* @return static
160160
*/
161-
public function withFragment($fragment)
161+
public function withFragment($fragment): UriInterface
162162
{
163163
throw new \BadMethodCallException('Not implemented.');
164164
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20-
"psr/http-message": "^1.0",
20+
"psr/http-message": "^1.0 || ^2.0",
2121
"symfony/http-foundation": "^5.4 || ^6.0"
2222
},
2323
"require-dev": {

0 commit comments

Comments
 (0)