This commit is contained in:
2026-06-12 15:41:04 -04:00
parent 40e7bf7898
commit 5f0a0c3a95
5 changed files with 34 additions and 2 deletions
+4 -1
View File
@@ -6,11 +6,14 @@
"php": "^8.5", "php": "^8.5",
"psr/http-factory": "^1.1", "psr/http-factory": "^1.1",
"psr/http-message": "^2.0", "psr/http-message": "^2.0",
"guzzlehttp/psr7": "^2.11",
"potter/closeable": "^0.0.1", "potter/closeable": "^0.0.1",
"potter/detachable": "^0.0.1", "potter/detachable": "^0.0.1",
"potter/rewindable": "^0.0.1", "potter/rewindable": "^0.0.1",
"potter/stringable": "^0.0.1", "potter/stringable": "^0.0.1",
"potter/writeable": "^0.0.1" "potter/writeable": "^0.0.1",
"potter/readable": "^0.0.1",
"potter/resource": "^0.0.1"
}, },
"license": "MIT", "license": "MIT",
"autoload": { "autoload": {
+10
View File
@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace Potter\Stream;
use \GuzzleHttp\Psr7\Stream as BaseStream;
abstract class AbstractStream extends BaseStream implements StreamInterface
{ }
+8
View File
@@ -0,0 +1,8 @@
<?php
declare(strict_types=1);
namespace Potter\Stream;
final class Stream extends AbstractStream
{ }
+3 -1
View File
@@ -13,10 +13,12 @@ use \Potter\Detachable\DetachableInterface;
use \Potter\Readable\ReadableInterface; use \Potter\Readable\ReadableInterface;
use \Potter\Writeable\WriteableInterface; use \Potter\Writeable\WriteableInterface;
use \Potter\Resource\ResourceInterface;
use \Psr\Http\Message\StreamInterface as PsrStreamInterface; use \Psr\Http\Message\StreamInterface as PsrStreamInterface;
interface StreamInterface extends PsrStreamInterface, StringableInterface, interface StreamInterface extends PsrStreamInterface, StringableInterface,
ReadableInterface, WriteableInterface, ReadableInterface, WriteableInterface, ResourceInterface,
CloseableInterface, DetachableInterface, CloseableInterface, DetachableInterface,
RewindableInterface, SeekableInterface RewindableInterface, SeekableInterface
{ {
+9
View File
@@ -0,0 +1,9 @@
<?php
require_once __DIR__ . '/vendor/autoload.php';
$server = stream_socket_server("tcp://127.0.0.1:23000",$errno,$errstr);
$stream = new \Potter\Stream\Stream($server);
echo $stream->getContents();