This commit is contained in:
2026-06-05 15:22:55 -04:00
parent f1e568c1e8
commit 524ec88821
4 changed files with 57 additions and 0 deletions
@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Potter\Message;
use \Psr\Http\Message\{
MessageInterface as PsrMessageInterface,
StreamInterface as PsrStreamInterface};
interface MessageBodyInterface
{
public function getBody(): PsrStreamInterface;
public function withBody(StreamInterface $body): PsrMessageInterface;
}
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Potter\Message;
use \Psr\Http\Message\MessageInterface as PsrMessageInterface;
interface MessageHeaderInterface
{
public function getHeaders(): array;
public function hasHeader(string $name): bool;
public function getHeader(string $name): array;
public function getHeaderLine(string $name): string;
public function withHeader(string $name, $value): PsrMessageInterface;
public function withAddedHeader(string $name, $value): PsrMessageInterface;
public function withoutHeader(string $name): PsrMessageInterface;
}
+11
View File
@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Potter\Message;
use \Psr\Http\Message\MessageInterface as PsrMessageInterface;
interface MessageInterface extends PsrMessageInterface,
MessageProtocolInterface, MessageHeaderInterface, MessageBodyInterface
{ }
@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Potter\Message;
use \Psr\Http\Message\MessageInterface as PsrMessageInterface;
interface MessageProtocolInterface
{
public function getProtocolVersion(): string;
public function withProtocolVersion(string $version): PsrMessageInterface;
}