diff --git a/src/Transport/Frame/Visitor/ChunkArguments.php b/src/Transport/Frame/Visitor/ChunkArguments.php deleted file mode 100644 index 43f3c2e..0000000 --- a/src/Transport/Frame/Visitor/ChunkArguments.php +++ /dev/null @@ -1,64 +0,0 @@ -> */ - private Sequence $frames; - - /** - * @no-named-arguments - * - * @param list> $frames - */ - public function __construct(Frame ...$frames) - { - $this->frames = Sequence::of(...$frames); - } - - /** - * @param Stream $arguments - * - * @return Maybe> - */ - public function __invoke(Stream $arguments): Maybe - { - /** - * @psalm-suppress NamedArgumentNotAllowed - * @var Frame> - */ - $frame = $this->frames->match( - static fn($first, $rest) => Frame\Composite::of( - static fn(Unpacked ...$values) => Sequence::of(...$values)->map( - static fn($unpacked) => $unpacked->unwrap(), - ), - $first, - ...$rest->toList(), - ), - static fn() => Frame\NoOp::of(Sequence::of()), - ); - - return $arguments - ->frames($frame) - ->one(); - } -} diff --git a/tests/Transport/Frame/Visitor/ChunkArgumentsTest.php b/tests/Transport/Frame/Visitor/ChunkArgumentsTest.php deleted file mode 100644 index 36c83af..0000000 --- a/tests/Transport/Frame/Visitor/ChunkArgumentsTest.php +++ /dev/null @@ -1,61 +0,0 @@ -pack()->toString().LongString::literal('foo')->pack()->toString(); - $io = IO::of(Select::waitForever(...)) - ->readable() - ->wrap(Stream::ofContent($arguments)) - ->toEncoding(Str\Encoding::ascii); - - $stream = $visit($io)->match( - static fn($arguments) => $arguments, - static fn() => null, - ); - - $this->assertInstanceOf(Sequence::class, $stream); - $this->assertCount(2, $stream); - $this->assertInstanceOf(Bits::class, $stream->get(0)->match( - static fn($value) => $value, - static fn() => null, - )); - $this->assertInstanceOf(LongString::class, $stream->get(1)->match( - static fn($value) => $value, - static fn() => null, - )); - $this->assertSame([true], $stream->get(0)->match( - static fn($value) => $value->original()->toList(), - static fn() => null, - )); - $this->assertSame('foo', $stream->get(1)->match( - static fn($value) => $value->original()->toString(), - static fn() => null, - )); - } -}