Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump psr/http-message version #113

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Bump psr/http-message version
  • Loading branch information
erikn69 committed Apr 20, 2023
commit ec83c1cc6ce8964da07019c182ed4ace30d5d03e
10 changes: 5 additions & 5 deletions Tests/Fixtures/Message.php
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ public function getProtocolVersion(): string
*
* @return static
*/
public function withProtocolVersion($version)
public function withProtocolVersion($version): MessageInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -72,7 +72,7 @@ public function getHeaderLine($name): string
*
* @return static
*/
public function withHeader($name, $value)
public function withHeader($name, $value): MessageInterface
{
$this->headers[$name] = (array) $value;

@@ -84,7 +84,7 @@ public function withHeader($name, $value)
*
* @return static
*/
public function withAddedHeader($name, $value)
public function withAddedHeader($name, $value): MessageInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -94,7 +94,7 @@ public function withAddedHeader($name, $value)
*
* @return static
*/
public function withoutHeader($name)
public function withoutHeader($name): MessageInterface
{
unset($this->headers[$name]);

@@ -111,7 +111,7 @@ public function getBody(): StreamInterface
*
* @return static
*/
public function withBody(StreamInterface $body)
public function withBody(StreamInterface $body): MessageInterface
{
throw new \BadMethodCallException('Not implemented.');
}
2 changes: 1 addition & 1 deletion Tests/Fixtures/Response.php
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ public function getStatusCode(): int
/**
* @return static
*/
public function withStatus($code, $reasonPhrase = '')
public function withStatus($code, $reasonPhrase = ''): ResponseInterface
{
throw new \BadMethodCallException('Not implemented.');
}
31 changes: 15 additions & 16 deletions Tests/Fixtures/ServerRequest.php
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@

namespace Symfony\Bridge\PsrHttpMessage\Tests\Fixtures;

use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
@@ -34,6 +35,10 @@ public function __construct($version = '1.1', array $headers = [], StreamInterfa
{
parent::__construct($version, $headers, $body);

if (!($uri instanceof UriInterface)) {
$uri = new Uri((string) $uri);
}

$this->requestTarget = $requestTarget;
$this->method = $method;
$this->uri = $uri;
@@ -52,10 +57,8 @@ public function getRequestTarget(): string

/**
* {@inheritdoc}
*
* @return static
*/
public function withRequestTarget($requestTarget)
public function withRequestTarget($requestTarget): RequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -67,20 +70,16 @@ public function getMethod(): string

/**
* {@inheritdoc}
*
* @return static
*/
public function withMethod($method)
public function withMethod($method): RequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}

/**
* {@inheritdoc}
*
* @return UriInterface
*/
public function getUri()
public function getUri(): UriInterface
{
return $this->uri;
}
@@ -90,7 +89,7 @@ public function getUri()
*
* @return static
*/
public function withUri(UriInterface $uri, $preserveHost = false)
public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -110,7 +109,7 @@ public function getCookieParams(): array
*
* @return static
*/
public function withCookieParams(array $cookies)
public function withCookieParams(array $cookies): ServerRequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -125,7 +124,7 @@ public function getQueryParams(): array
*
* @return static
*/
public function withQueryParams(array $query)
public function withQueryParams(array $query): ServerRequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -140,7 +139,7 @@ public function getUploadedFiles(): array
*
* @return static
*/
public function withUploadedFiles(array $uploadedFiles)
public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -160,7 +159,7 @@ public function getParsedBody()
*
* @return static
*/
public function withParsedBody($data)
public function withParsedBody($data): ServerRequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -185,7 +184,7 @@ public function getAttribute($name, $default = null)
*
* @return static
*/
public function withAttribute($name, $value)
public function withAttribute($name, $value): ServerRequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -195,7 +194,7 @@ public function withAttribute($name, $value)
*
* @return static
*/
public function withoutAttribute($name)
public function withoutAttribute($name): ServerRequestInterface
{
throw new \BadMethodCallException('Not implemented.');
}
3 changes: 2 additions & 1 deletion Tests/Fixtures/UploadedFile.php
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@

namespace Symfony\Bridge\PsrHttpMessage\Tests\Fixtures;

use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UploadedFileInterface;

/**
@@ -33,7 +34,7 @@ public function __construct($filePath, $size = null, $error = \UPLOAD_ERR_OK, $c
$this->clientMediaType = $clientMediaType;
}

public function getStream(): Stream
public function getStream(): StreamInterface
{
return new Stream(file_get_contents($this->filePath));
}
14 changes: 7 additions & 7 deletions Tests/Fixtures/Uri.php
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ public function getFragment(): string
*
* @return static
*/
public function withScheme($scheme)
public function withScheme($scheme): UriInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -108,7 +108,7 @@ public function withScheme($scheme)
*
* @return static
*/
public function withUserInfo($user, $password = null)
public function withUserInfo($user, $password = null): UriInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -118,7 +118,7 @@ public function withUserInfo($user, $password = null)
*
* @return static
*/
public function withHost($host)
public function withHost($host): UriInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -128,7 +128,7 @@ public function withHost($host)
*
* @return static
*/
public function withPort($port)
public function withPort($port): UriInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -138,7 +138,7 @@ public function withPort($port)
*
* @return static
*/
public function withPath($path)
public function withPath($path): UriInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -148,7 +148,7 @@ public function withPath($path)
*
* @return static
*/
public function withQuery($query)
public function withQuery($query): UriInterface
{
throw new \BadMethodCallException('Not implemented.');
}
@@ -158,7 +158,7 @@ public function withQuery($query)
*
* @return static
*/
public function withFragment($fragment)
public function withFragment($fragment): UriInterface
{
throw new \BadMethodCallException('Not implemented.');
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
],
"require": {
"php": ">=7.2.5",
"psr/http-message": "^1.0",
"psr/http-message": "^1.0 || ^2.0",
"symfony/http-foundation": "^5.4 || ^6.0"
},
"require-dev": {