Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
InlineRunnerFactory | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
createRunner | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | namespace Apie\McpServer\Factory; |
3 | |
4 | use Apie\McpServer\Runner\InlineRunner; |
5 | use Mcp\Server\Server; |
6 | use Psr\Log\LoggerInterface; |
7 | |
8 | class InlineRunnerFactory implements RunnerFactoryInterface |
9 | { |
10 | /** |
11 | * @param array<int, JsonRpcMessage> $messages |
12 | */ |
13 | public function __construct( |
14 | private readonly LoggerInterface $logger, |
15 | private array $messages = [] |
16 | ) { |
17 | } |
18 | |
19 | public function createRunner(Server $server): InlineRunner |
20 | { |
21 | return new InlineRunner( |
22 | $server, |
23 | $server->createInitializationOptions(), |
24 | $this->logger, |
25 | $this->messages |
26 | ); |
27 | } |
28 | } |