Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 0 additions & 87 deletions src/Transport/AbstractTransport.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Transport/HttpTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Origin checks, complex ACK logic, and related session properties have been removed.
* It primarily focuses on basic JSON-RPC via POST.
*/
class HttpTransport extends AbstractTransport
class HttpTransport implements TransportInterface
{
// Kept essential properties for basic POST JSON-RPC.
/** @var ResponseInterface|null The PSR-7 response object being prepared. */
Expand Down
2 changes: 1 addition & 1 deletion src/Transport/StdioTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Implements a transport using STDIN, STDOUT, and STDERR for line-based JSON messaging.
* Each JSON-RPC message (or batch of messages) is expected to be on a single line.
*/
class StdioTransport extends AbstractTransport
class StdioTransport implements TransportInterface
{
/** @var resource The standard input stream. */
private $stdin;
Expand Down
20 changes: 0 additions & 20 deletions src/Transport/TransportInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ public function receive(): ?array;
*/
public function send(JsonRpcMessage|array $message): void;

/**
* Logs a message specific to the transport's operation.
*
* Example: For StdioTransport, this might write to STDERR.
* For HttpTransport, it might use a PSR-3 logger if integrated.
*
* @param string $message The message to log.
*/
public function log(string $message): void;

/**
* Checks if the transport connection is considered closed.
*
Expand All @@ -79,14 +69,4 @@ public function isClosed(): bool;
* @return bool True if a stream is actively open, false otherwise.
*/
public function isStreamOpen(): bool;

/**
* Hints to the transport that Server-Sent Events (SSE) are preferred for the response stream, if applicable.
*
* Transports that support SSE (e.g., HttpTransport) can use this to modify
* how they format and send responses. Transports that do not support SSE can ignore this hint.
*
* @param bool $prefer True to indicate a preference for SSE streaming, false otherwise.
*/
public function preferSseStream(bool $prefer = true): void;
}
6 changes: 0 additions & 6 deletions tests/Util/MockTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ public function log(string $message): void
// error_log("MockTransport Log: " . $message); // For debugging tests
}

public function preferSseStream(bool $prefer = true): void
{
// No-op for this mock implementation.
// Could store the preference if tests need to assert it was called.
}

/**
* Checks if the transport stream is currently open.
* For this mock, defaults to false. Can be made configurable if needed.
Expand Down