[Server] Simplify server extensibility with pluggable method handlers (#100)

* refactor: use a custom method handler registration system

* refactor: remove redundant Completer and CompleterInterface

* docs: update server-builder documentation to reflect custom method handler changes
This commit is contained in:
Kyrian Obikwelu 2025-10-07 23:25:06 +01:00 • committed by GitHub
commit fcf605d5d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,10 +57,10 @@ class HandlerTest extends TestCase
$sessionStore->method('exists')->willReturn(true);
$jsonRpc = new JsonRpcHandler(
MessageFactory::make(),
$sessionFactory,
$sessionStore,
[$handlerA, $handlerB, $handlerC]
methodHandlers: [$handlerA, $handlerB, $handlerC],
messageFactory: MessageFactory::make(),
sessionFactory: $sessionFactory,
sessionStore: $sessionStore,
);
$sessionId = Uuid::v4();
$result = $jsonRpc->process(
@ -103,10 +103,10 @@ class HandlerTest extends TestCase
$sessionStore->method('exists')->willReturn(true);
$jsonRpc = new JsonRpcHandler(
MessageFactory::make(),
$sessionFactory,
$sessionStore,
[$handlerA, $handlerB, $handlerC]
methodHandlers: [$handlerA, $handlerB, $handlerC],
messageFactory: MessageFactory::make(),
sessionFactory: $sessionFactory,
sessionStore: $sessionStore,
);
$sessionId = Uuid::v4();
$result = $jsonRpc->process(