Skip to content

Commit fd0aa5f

Browse files
committed
remove some comments
1 parent 7c5cbcc commit fd0aa5f

File tree

7 files changed

+10
-21
lines changed

7 files changed

+10
-21
lines changed

src/Capability/Discovery/CachedDiscoverer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* to improve performance when discovery is called multiple times.
2222
*
2323
* @internal
24+
*
2425
* @final
2526
*
2627
* @author Xentixar <xentixar@gmail.com>

src/Capability/Discovery/Discoverer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* }
4444
*
4545
* @internal
46+
*
4647
* @final
4748
*
4849
* @author Kyrian Obikwelu <koshnawaza@gmail.com>

src/Capability/Discovery/DiscovererInterface.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
/**
1515
* Discovers MCP elements (tools, resources, prompts, resource templates) in directories.
1616
*
17-
* Implementations can use different strategies:
18-
* - File system scanning with reflection
19-
* - Cached discovery
20-
* - Pre-configured discovery
21-
*
2217
* @internal
2318
*
2419
* @author Antoine Bluchet <soyuka@gmail.com>

src/Capability/Discovery/SchemaGenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public function generate(\Reflector $reflection): array
7878
throw new \BadMethodCallException(\sprintf('Schema generation from %s is not supported.', $reflection::class));
7979
}
8080

81+
if (!$reflection instanceof \ReflectionMethod && !$reflection instanceof \ReflectionFunction) {
82+
throw new \BadMethodCallException(\sprintf('Schema generation from %s is not supported.', $reflection::class));
83+
}
84+
8185
$methodSchema = $this->extractMethodLevelSchema($reflection);
8286

8387
if ($methodSchema && isset($methodSchema['definition'])) {
@@ -92,8 +96,6 @@ public function generate(\Reflector $reflection): array
9296
/**
9397
* Extracts method-level or function-level Schema attribute.
9498
*
95-
* @param \ReflectionFunctionAbstract $reflection
96-
*
9799
* @return SchemaAttributeData
98100
*/
99101
private function extractMethodLevelSchema(\ReflectionFunctionAbstract $reflection): ?array
@@ -411,11 +413,9 @@ private function applyArrayConstraints(array $paramSchema, array $paramInfo): ar
411413
/**
412414
* Parses detailed information about a method's parameters.
413415
*
414-
* @param \ReflectionFunctionAbstract $reflection
415-
*
416416
* @return ParameterInfo[]
417417
*/
418-
private function parseParametersInfo(\ReflectionFunctionAbstract $reflection): array
418+
private function parseParametersInfo(\ReflectionMethod|\ReflectionFunction $reflection): array
419419
{
420420
$docComment = $reflection->getDocComment() ?: null;
421421
$docBlock = $this->docBlockParser->parseDocBlock($docComment);

src/Capability/Discovery/SchemaGeneratorInterface.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
/**
1515
* Provides JSON Schema generation for reflected elements.
1616
*
17-
* Implementations can use different strategies to generate schemas:
18-
* - Reflection-based (types and docblocks)
19-
* - Attribute-based (Schema attributes)
20-
* - External libraries (API Platform, etc.)
21-
* - Class-based metadata
22-
*
2317
* @author Antoine Bluchet <soyuka@gmail.com>
2418
*/
2519
interface SchemaGeneratorInterface
@@ -28,11 +22,7 @@ interface SchemaGeneratorInterface
2822
* Generates a JSON Schema for input parameters.
2923
*
3024
* The returned schema must be a valid JSON Schema object (type: 'object')
31-
* with properties corresponding to parameters.
32-
*
33-
* - For ReflectionMethod/ReflectionFunction: schema based on method parameters
34-
* - For ReflectionClass: schema based on __construct, __invoke parameters,
35-
* or class properties/metadata
25+
* with properties corresponding to a tool's parameters.
3626
*
3727
* @return array{
3828
* type: 'object',

src/Capability/Registry/Loader/ArrayLoader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Mcp\Capability\Completion\ProviderInterface;
1818
use Mcp\Capability\Discovery\DocBlockParser;
1919
use Mcp\Capability\Discovery\HandlerResolver;
20+
use Mcp\Capability\Discovery\SchemaGenerator;
2021
use Mcp\Capability\Discovery\SchemaGeneratorInterface;
2122
use Mcp\Capability\Registry\ElementReference;
2223
use Mcp\Capability\RegistryInterface;

src/Capability/Registry/Loader/DiscoveryLoader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Mcp\Capability\RegistryInterface;
1616

1717
/**
18+
* @internal
1819
* @author Antoine Bluchet <soyuka@gmail.com>
1920
*/
2021
final class DiscoveryLoader implements LoaderInterface

0 commit comments

Comments
 (0)