File tree Expand file tree Collapse file tree 13 files changed +27
-27
lines changed Expand file tree Collapse file tree 13 files changed +27
-27
lines changed Original file line number Diff line number Diff line change 5
5
use PhpLlm \McpSdk \Capability \PromptChain ;
6
6
use PhpLlm \McpSdk \Capability \ResourceChain ;
7
7
use PhpLlm \McpSdk \Capability \ToolChain ;
8
- use PhpLlm \McpSdk \Server \NotificationHandler ;
8
+ use PhpLlm \McpSdk \Server \NotificationHandlerInterface ;
9
9
use PhpLlm \McpSdk \Server \NotificationHandler \InitializedHandler ;
10
- use PhpLlm \McpSdk \Server \RequestHandler ;
10
+ use PhpLlm \McpSdk \Server \RequestHandlerInterface ;
11
11
use PhpLlm \McpSdk \Server \RequestHandler \InitializeHandler ;
12
12
use PhpLlm \McpSdk \Server \RequestHandler \PingHandler ;
13
13
use PhpLlm \McpSdk \Server \RequestHandler \PromptGetHandler ;
20
20
class Builder
21
21
{
22
22
/**
23
- * @return list<RequestHandler >
23
+ * @return list<RequestHandlerInterface >
24
24
*/
25
25
public static function buildRequestHandlers (): array
26
26
{
@@ -49,7 +49,7 @@ public static function buildRequestHandlers(): array
49
49
}
50
50
51
51
/**
52
- * @return list<NotificationHandler >
52
+ * @return list<NotificationHandlerInterface >
53
53
*/
54
54
public static function buildNotificationHandlers (): array
55
55
{
Original file line number Diff line number Diff line change 5
5
namespace PhpLlm \McpSdk ;
6
6
7
7
use PhpLlm \McpSdk \Server \JsonRpcHandler ;
8
- use PhpLlm \McpSdk \Server \Transport ;
8
+ use PhpLlm \McpSdk \Server \TransportInterface ;
9
9
use Psr \Log \LoggerInterface ;
10
10
use Psr \Log \NullLogger ;
11
11
@@ -17,7 +17,7 @@ public function __construct(
17
17
) {
18
18
}
19
19
20
- public function connect (Transport $ transport ): void
20
+ public function connect (TransportInterface $ transport ): void
21
21
{
22
22
$ transport ->initialize ();
23
23
$ this ->logger ->info ('Transport initialized ' );
Original file line number Diff line number Diff line change 17
17
readonly class JsonRpcHandler
18
18
{
19
19
/**
20
- * @var array<int, RequestHandler >
20
+ * @var array<int, RequestHandlerInterface >
21
21
*/
22
22
private array $ requestHandlers ;
23
23
24
24
/**
25
- * @var array<int, NotificationHandler >
25
+ * @var array<int, NotificationHandlerInterface >
26
26
*/
27
27
private array $ notificationHandlers ;
28
28
29
29
/**
30
- * @param iterable<RequestHandler > $requestHandlers
31
- * @param iterable<NotificationHandler > $notificationHandlers
30
+ * @param iterable<RequestHandlerInterface > $requestHandlers
31
+ * @param iterable<NotificationHandlerInterface > $notificationHandlers
32
32
*/
33
33
public function __construct (
34
34
private Factory $ messageFactory ,
Original file line number Diff line number Diff line change 5
5
namespace PhpLlm \McpSdk \Server \NotificationHandler ;
6
6
7
7
use PhpLlm \McpSdk \Message \Notification ;
8
- use PhpLlm \McpSdk \Server \NotificationHandler ;
8
+ use PhpLlm \McpSdk \Server \NotificationHandlerInterface ;
9
9
10
- abstract class BaseNotificationHandler implements NotificationHandler
10
+ abstract class BaseNotificationHandler implements NotificationHandlerInterface
11
11
{
12
12
public function supports (Notification $ message ): bool
13
13
{
Original file line number Diff line number Diff line change 6
6
7
7
use PhpLlm \McpSdk \Message \Notification ;
8
8
9
- interface NotificationHandler
9
+ interface NotificationHandlerInterface
10
10
{
11
11
public function supports (Notification $ message ): bool ;
12
12
Original file line number Diff line number Diff line change 5
5
namespace PhpLlm \McpSdk \Server \RequestHandler ;
6
6
7
7
use PhpLlm \McpSdk \Message \Request ;
8
- use PhpLlm \McpSdk \Server \RequestHandler ;
8
+ use PhpLlm \McpSdk \Server \RequestHandlerInterface ;
9
9
10
- abstract class BaseRequestHandler implements RequestHandler
10
+ abstract class BaseRequestHandler implements RequestHandlerInterface
11
11
{
12
12
public function supports (Request $ message ): bool
13
13
{
Original file line number Diff line number Diff line change 8
8
use PhpLlm \McpSdk \Message \Request ;
9
9
use PhpLlm \McpSdk \Message \Response ;
10
10
11
- interface RequestHandler
11
+ interface RequestHandlerInterface
12
12
{
13
13
public function supports (Request $ message ): bool ;
14
14
Original file line number Diff line number Diff line change 4
4
5
5
namespace PhpLlm \McpSdk \Server \Transport \Sse \Store ;
6
6
7
- use PhpLlm \McpSdk \Server \Transport \Sse \Store ;
7
+ use PhpLlm \McpSdk \Server \Transport \Sse \StoreInterface ;
8
8
use Psr \Cache \CacheItemPoolInterface ;
9
9
use Symfony \Component \Uid \Uuid ;
10
10
11
- final readonly class CachePoolStore implements Store
11
+ final readonly class CachePoolStore implements StoreInterface
12
12
{
13
13
public function __construct (
14
14
private CacheItemPoolInterface $ cachePool ,
Original file line number Diff line number Diff line change 6
6
7
7
use Symfony \Component \Uid \Uuid ;
8
8
9
- interface Store
9
+ interface StoreInterface
10
10
{
11
11
public function push (Uuid $ id , string $ message ): void ;
12
12
Original file line number Diff line number Diff line change 4
4
5
5
namespace PhpLlm \McpSdk \Server \Transport \Sse ;
6
6
7
- use PhpLlm \McpSdk \Server \Transport ;
7
+ use PhpLlm \McpSdk \Server \TransportInterface ;
8
8
use Symfony \Component \Uid \Uuid ;
9
9
10
- final readonly class StreamTransport implements Transport
10
+ final readonly class StreamTransport implements TransportInterface
11
11
{
12
12
public function __construct (
13
13
private string $ messageEndpoint ,
14
- private Store $ store ,
14
+ private StoreInterface $ store ,
15
15
private Uuid $ id ,
16
16
) {
17
17
}
Original file line number Diff line number Diff line change 4
4
5
5
namespace PhpLlm \McpSdk \Server \Transport \Stdio ;
6
6
7
- use PhpLlm \McpSdk \Server \Transport ;
7
+ use PhpLlm \McpSdk \Server \TransportInterface ;
8
8
use Symfony \Component \Console \Input \InputInterface ;
9
9
use Symfony \Component \Console \Input \StreamableInputInterface ;
10
10
use Symfony \Component \Console \Output \OutputInterface ;
11
11
12
12
/**
13
13
* Heavily inspired by https://jolicode.com/blog/mcp-the-open-protocol-that-turns-llm-chatbots-into-intelligent-agents.
14
14
*/
15
- final class SymfonyConsoleTransport implements Transport
15
+ final class SymfonyConsoleTransport implements TransportInterface
16
16
{
17
17
private string $ buffer = '' ;
18
18
Original file line number Diff line number Diff line change 4
4
5
5
namespace PhpLlm \McpSdk \Server ;
6
6
7
- interface Transport
7
+ interface TransportInterface
8
8
{
9
9
public function initialize (): void ;
10
10
Original file line number Diff line number Diff line change 2
2
3
3
namespace PhpLlm \McpSdk \Tests \Fixtures ;
4
4
5
- use PhpLlm \McpSdk \Server \Transport ;
5
+ use PhpLlm \McpSdk \Server \TransportInterface ;
6
6
7
- class InMemoryTransport implements Transport
7
+ class InMemoryTransport implements TransportInterface
8
8
{
9
9
private bool $ connected = true ;
10
10
You can’t perform that action at this time.
0 commit comments