Adopt Schema component in server handlers
This commit is contained in:
parent
6025f890f9
commit
09707b4798
1 changed files with 1516 additions and 2424 deletions
|
|
@ -1,50 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the official PHP MCP SDK.
|
||||
*
|
||||
* A collaboration between Symfony and the PHP Foundation.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Mcp\Tests\Fixtures;
|
||||
|
||||
use Mcp\Server\TransportInterface;
|
||||
|
||||
class InMemoryTransport implements TransportInterface
|
||||
{
|
||||
private bool $connected = true;
|
||||
|
||||
/**
|
||||
* @param list<string> $messages
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly array $messages = [],
|
||||
) {
|
||||
}
|
||||
|
||||
public function initialize(): void
|
||||
{
|
||||
}
|
||||
|
||||
public function isConnected(): bool
|
||||
{
|
||||
return $this->connected;
|
||||
}
|
||||
|
||||
public function receive(): \Generator
|
||||
{
|
||||
yield from $this->messages;
|
||||
$this->connected = false;
|
||||
}
|
||||
|
||||
public function send(string $data): void
|
||||
{
|
||||
}
|
||||
|
||||
public function close(): void
|
||||
{
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue