Skip to content

Commit a7ddc11

Browse files
authored
Add missing ConfigurationException and update PHPStan baseline (#31)
- Add ConfigurationException class in src/Exception/ConfigurationException.php - Update ServerBuilder to use the new ConfigurationException - Regenerate PHPStan baseline to account for the new exception class, reducing errors from 160+ to 124
1 parent 7eaca45 commit a7ddc11

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -558,12 +558,6 @@ parameters:
558558
count: 1
559559
path: src/Server/RequestHandler/ListToolsHandler.php
560560

561-
-
562-
message: '#^Instantiated class Mcp\\Server\\ConfigurationException not found\.$#'
563-
identifier: class.notFound
564-
count: 4
565-
path: src/Server/ServerBuilder.php
566-
567561
-
568562
message: '#^Method Mcp\\Server\\ServerBuilder\:\:getCompletionProviders\(\) return type has no value type specified in iterable type array\.$#'
569563
identifier: missingType.iterableValue
@@ -701,9 +695,3 @@ parameters:
701695
identifier: property.onlyWritten
702696
count: 1
703697
path: src/Server/ServerBuilder.php
704-
705-
-
706-
message: '#^Throwing object of an unknown class Mcp\\Server\\ConfigurationException\.$#'
707-
identifier: class.notFound
708-
count: 4
709-
path: src/Server/ServerBuilder.php
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the official PHP MCP SDK.
5+
*
6+
* A collaboration between Symfony and the PHP Foundation.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Mcp\Exception;
13+
14+
/**
15+
* @author Oskar Stark <oskarstark@googlemail.com>
16+
*/
17+
class ConfigurationException extends InvalidArgumentException
18+
{
19+
}

src/Server/ServerBuilder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Mcp\Capability\Registry;
2222
use Mcp\Capability\Registry\Container;
2323
use Mcp\Capability\Registry\ReferenceHandler;
24+
use Mcp\Exception\ConfigurationException;
2425
use Mcp\JsonRpc\Handler;
2526
use Mcp\Schema\Annotations;
2627
use Mcp\Schema\Implementation;

0 commit comments

Comments
 (0)