Compare commits

..

2 Commits

Author SHA1 Message Date
jay 14d37a402a 0.0.1 2026-06-05 15:23:03 -04:00
jay 524ec88821 0.0.1 2026-06-05 15:22:55 -04:00
6 changed files with 64 additions and 6 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
# Template
# Message
Potter Framework Component Template
Potter Framework Message Interface
+5 -4
View File
@@ -1,14 +1,15 @@
{
"name": "potter/template",
"description": "Potter Framework Component Template",
"name": "potter/message",
"description": "Potter Framework Message Interface",
"type": "library",
"require": {
"php": "^8.5"
"php": "^8.5",
"psr/http-message": "^2.0"
},
"license": "MIT",
"autoload": {
"psr-4": {
"Potter\\": "src/Potter/"
"Potter\\Message\\": "src/Potter/Message/"
}
},
"authors": [
@@ -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;
}