Skip to content

Commit ec1e63b

Browse files
committed
Updated with latest Server method interface
1 parent 30f8f42 commit ec1e63b

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

examples/stdio-logging-showcase/server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
$transport = new StdioTransport(logger: logger());
3131

32-
$server->connect($transport);
32+
$server->run($transport);
3333

3434
logger()->info('Logging Showcase Server is ready!');
3535
logger()->info('This example demonstrates auto-injection of McpLogger into capability handlers.');

src/Server/NotificationSender.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
*/
2929
final class NotificationSender
3030
{
31+
/**
32+
* @param TransportInterface<mixed>|null $transport
33+
*/
3134
public function __construct(
3235
private readonly NotificationHandler $notificationHandler,
3336
private ?TransportInterface $transport = null,
@@ -37,6 +40,8 @@ public function __construct(
3740

3841
/**
3942
* Sets the transport interface for sending notifications.
43+
*
44+
* @param TransportInterface<mixed> $transport
4045
*/
4146
public function setTransport(TransportInterface $transport): void
4247
{

tests/Unit/Capability/Discovery/DocBlockTestFixture.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public function methodWithReturn(): string
7777
*/
7878
public function methodWithMultipleTags(float $value): bool
7979
{
80+
if ($value < 0) {
81+
throw new \RuntimeException('Processing failed for negative values');
82+
}
83+
8084
return true;
8185
}
8286

tests/Unit/Server/NotificationSenderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
final class NotificationSenderTest extends TestCase
2828
{
2929
private NotificationHandler $notificationHandler;
30+
/** @var TransportInterface<mixed>&MockObject */
3031
private TransportInterface&MockObject $transport;
3132
private LoggerInterface&MockObject $logger;
3233
private ReferenceProviderInterface&MockObject $referenceProvider;

tests/Unit/ServerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,5 @@ public function testJsonExceptions()
4848
$notificationSender = new NotificationSender($notificationHandler);
4949
$server = new Server($handler, $notificationSender);
5050
$server->run($transport);
51-
52-
$transport->listen();
5351
}
5452
}

0 commit comments

Comments
 (0)