From 9459fad6e4a252d4e5499319afa9d86dd7c7f1aa Mon Sep 17 00:00:00 2001 From: Kyrian Obikwelu Date: Fri, 19 Dec 2025 18:51:44 +0100 Subject: [PATCH 1/3] fix: correct Resource type hints in ListResourcesResult --- src/Schema/Result/ListResourcesResult.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Schema/Result/ListResourcesResult.php b/src/Schema/Result/ListResourcesResult.php index a6be7559..39128df2 100644 --- a/src/Schema/Result/ListResourcesResult.php +++ b/src/Schema/Result/ListResourcesResult.php @@ -26,8 +26,8 @@ class ListResourcesResult implements ResultInterface { /** - * @param array $resources the list of resource definitions - * @param string|null $nextCursor An opaque token representing the pagination position after the last returned result. + * @param array $resources the list of resource definitions + * @param string|null $nextCursor An opaque token representing the pagination position after the last returned result. * * If present, there may be more results available. */ @@ -57,7 +57,7 @@ public static function fromArray(array $data): self /** * @return array{ - * resources: array, + * resources: array, * nextCursor?: string, * } */ From 65d598c5d7ad6f3c5e336b117fedaa65114dd784 Mon Sep 17 00:00:00 2001 From: Kyrian Obikwelu Date: Fri, 19 Dec 2025 18:58:47 +0100 Subject: [PATCH 2/3] fix: phpstan errors --- src/Schema/Result/ListResourcesResult.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Schema/Result/ListResourcesResult.php b/src/Schema/Result/ListResourcesResult.php index 39128df2..641cf533 100644 --- a/src/Schema/Result/ListResourcesResult.php +++ b/src/Schema/Result/ListResourcesResult.php @@ -26,7 +26,7 @@ class ListResourcesResult implements ResultInterface { /** - * @param array $resources the list of resource definitions + * @param array $resources the list of resource definitions * @param string|null $nextCursor An opaque token representing the pagination position after the last returned result. * * If present, there may be more results available. @@ -57,7 +57,7 @@ public static function fromArray(array $data): self /** * @return array{ - * resources: array, + * resources: array, * nextCursor?: string, * } */ From 6972f0263fdc07de860c518548814887b49daede Mon Sep 17 00:00:00 2001 From: Kyrian Obikwelu Date: Fri, 19 Dec 2025 19:14:58 +0100 Subject: [PATCH 3/3] fix: phpstan errors --- src/Schema/Result/ListResourcesResult.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Schema/Result/ListResourcesResult.php b/src/Schema/Result/ListResourcesResult.php index 641cf533..aa005639 100644 --- a/src/Schema/Result/ListResourcesResult.php +++ b/src/Schema/Result/ListResourcesResult.php @@ -14,20 +14,20 @@ use Mcp\Exception\InvalidArgumentException; use Mcp\Schema\JsonRpc\Response; use Mcp\Schema\JsonRpc\ResultInterface; -use Mcp\Schema\Resource; +use Mcp\Schema\Resource as ResourceSchema; /** * The server's response to a resources/list request from the client. * - * @phpstan-import-type ResourceData from Resource + * @phpstan-import-type ResourceData from ResourceSchema * * @author Kyrian Obikwelu */ class ListResourcesResult implements ResultInterface { /** - * @param array $resources the list of resource definitions - * @param string|null $nextCursor An opaque token representing the pagination position after the last returned result. + * @param array $resources the list of resource definitions + * @param string|null $nextCursor An opaque token representing the pagination position after the last returned result. * * If present, there may be more results available. */ @@ -50,14 +50,14 @@ public static function fromArray(array $data): self } return new self( - array_map(fn (array $resource) => Resource::fromArray($resource), $data['resources']), + array_map(fn (array $resource) => ResourceSchema::fromArray($resource), $data['resources']), $data['nextCursor'] ?? null ); } /** * @return array{ - * resources: array, + * resources: array, * nextCursor?: string, * } */