This commit is contained in:
wangjinlei
2024-12-31 10:28:40 +08:00
parent 145b0ab8a5
commit a54a837670
1179 changed files with 2686 additions and 230376 deletions

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Psr\Http\Message;
/**
@@ -23,7 +25,7 @@ interface MessageInterface
*
* @return string HTTP protocol version.
*/
public function getProtocolVersion(): string;
public function getProtocolVersion();
/**
* Return an instance with the specified HTTP protocol version.
@@ -38,7 +40,7 @@ interface MessageInterface
* @param string $version HTTP protocol version
* @return static
*/
public function withProtocolVersion(string $version): MessageInterface;
public function withProtocolVersion(string $version);
/**
* Retrieves all message header values.
@@ -65,7 +67,7 @@ interface MessageInterface
* key MUST be a header name, and each value MUST be an array of strings
* for that header.
*/
public function getHeaders(): array;
public function getHeaders();
/**
* Checks if a header exists by the given case-insensitive name.
@@ -75,7 +77,7 @@ interface MessageInterface
* name using a case-insensitive string comparison. Returns false if
* no matching header name is found in the message.
*/
public function hasHeader(string $name): bool;
public function hasHeader(string $name);
/**
* Retrieves a message header value by the given case-insensitive name.
@@ -91,7 +93,7 @@ interface MessageInterface
* header. If the header does not appear in the message, this method MUST
* return an empty array.
*/
public function getHeader(string $name): array;
public function getHeader(string $name);
/**
* Retrieves a comma-separated string of the values for a single header.
@@ -112,7 +114,7 @@ interface MessageInterface
* concatenated together using a comma. If the header does not appear in
* the message, this method MUST return an empty string.
*/
public function getHeaderLine(string $name): string;
public function getHeaderLine(string $name);
/**
* Return an instance with the provided value replacing the specified header.
@@ -129,7 +131,7 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withHeader(string $name, $value): MessageInterface;
public function withHeader(string $name, $value);
/**
* Return an instance with the specified header appended with the given value.
@@ -147,7 +149,7 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withAddedHeader(string $name, $value): MessageInterface;
public function withAddedHeader(string $name, $value);
/**
* Return an instance without the specified header.
@@ -161,14 +163,14 @@ interface MessageInterface
* @param string $name Case-insensitive header field name to remove.
* @return static
*/
public function withoutHeader(string $name): MessageInterface;
public function withoutHeader(string $name);
/**
* Gets the body of the message.
*
* @return StreamInterface Returns the body as a stream.
*/
public function getBody(): StreamInterface;
public function getBody();
/**
* Return an instance with the specified message body.
@@ -183,5 +185,5 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException When the body is not valid.
*/
public function withBody(StreamInterface $body): MessageInterface;
public function withBody(StreamInterface $body);
}