Add support for pagination on list requests (#55)

10 - Added the list resources handler with test class

10 - Update the ListPromptsHandler to use annotations

10 - Add the list resource handler, and it's test as well

10 - Added the registry logic

10 - Added the list tools handler logic

10 - Fix all php-cs-fixer related issues

10 - Resolved phpstan issues for ListPromptsHandlerTest

10 - Resolved phpstan issues for ListToolsHandlerTest

10 - Resolved phpstan issues for ListResourcesHandlerTest

10 - Resolved phpstan issues in registry class

10 - Resolved phpstan issues for the handler class

10 - Resolved php cs fixer issues

10 - Resolved all phpstan issues by generating the baseline again

10 - Remove the two loop operation and use foreach for optimization

10 - Removed unused code and resolved namespace

10 - Add signatures to interface and registry

10 - Add updated phpstan rule set

10 - Arranged according to property type

10 - Introduce reference page DTO, fix all failing test

10 - Resolve cs-fixer issues

10 - Resolve phpstan issues

10 - Resolve php cs fixer issues

10 - Created a reference directory for the Page DTO

10 - Remove manual loop for clean code readability

Co-authored-by: larry.sulebalogun <larry.sulebalogun@tillo.io>
This commit is contained in:
Sule-Balogun Olanrewaju 2025-09-24 20:44:32 +01:00 • committed by GitHub
commit 325b4aaf9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,6 @@ parameters:
count: 1
path: examples/02-discovery-http-userprofile/server.php
-
message: '#^Method Mcp\\Example\\ManualStdioExample\\SimpleHandlers\:\:getItemDetails\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
@ -73,7 +72,6 @@ parameters:
count: 2
path: examples/04-combined-registration-http/server.php
-
message: '#^Method Mcp\\Example\\StdioEnvVariables\\EnvToolHandler\:\:processData\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
@ -266,7 +264,6 @@ parameters:
count: 2
path: examples/07-complex-tool-schema-http/McpEventScheduler.php
-
message: '#^Method Mcp\\Example\\SchemaShowcaseExample\\SchemaShowcaseElements\:\:calculateRange\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
@ -321,8 +318,6 @@ parameters:
count: 1
path: examples/08-schema-showcase-streamable/SchemaShowcaseElements.php
-
message: '#^Call to an undefined method Mcp\\Capability\\Registry\\ResourceTemplateReference\:\:handle\(\)\.$#'
identifier: method.notFound
@ -341,78 +336,6 @@ parameters:
count: 1
path: src/Schema/Result/ReadResourceResult.php
-
message: '#^Method Mcp\\Capability\\Registry\\ReferenceProviderInterface\:\:getPrompts\(\) invoked with 2 parameters, 0 required\.$#'
identifier: arguments.count
count: 1
path: src/Server/RequestHandler/ListPromptsHandler.php
-
message: '#^Result of && is always false\.$#'
identifier: booleanAnd.alwaysFalse
count: 1
path: src/Server/RequestHandler/ListPromptsHandler.php
-
message: '#^Strict comparison using \!\=\= between null and null will always evaluate to false\.$#'
identifier: notIdentical.alwaysFalse
count: 1
path: src/Server/RequestHandler/ListPromptsHandler.php
-
message: '#^Method Mcp\\Capability\\Registry\\ReferenceProviderInterface\:\:getResources\(\) invoked with 2 parameters, 0 required\.$#'
identifier: arguments.count
count: 1
path: src/Server/RequestHandler/ListResourcesHandler.php
-
message: '#^Result of && is always false\.$#'
identifier: booleanAnd.alwaysFalse
count: 1
path: src/Server/RequestHandler/ListResourcesHandler.php
-
message: '#^Strict comparison using \!\=\= between null and null will always evaluate to false\.$#'
identifier: notIdentical.alwaysFalse
count: 1
path: src/Server/RequestHandler/ListResourcesHandler.php
-
message: '#^Method Mcp\\Capability\\Registry\\ReferenceProviderInterface\:\:getTools\(\) invoked with 2 parameters, 0 required\.$#'
identifier: arguments.count
count: 1
path: src/Server/RequestHandler/ListToolsHandler.php
-
message: '#^Result of && is always false\.$#'
identifier: booleanAnd.alwaysFalse
count: 1
path: src/Server/RequestHandler/ListToolsHandler.php
-
message: '#^Strict comparison using \!\=\= between null and null will always evaluate to false\.$#'
identifier: notIdentical.alwaysFalse
count: 1
path: src/Server/RequestHandler/ListToolsHandler.php
-
message: '#^Method Mcp\\Server\\ServerBuilder\:\:getCompletionProviders\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Method Mcp\\Server\\ServerBuilder\:\:setDiscovery\(\) has parameter \$excludeDirs with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Method Mcp\\Server\\ServerBuilder\:\:setDiscovery\(\) has parameter \$scanDirs with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Method Mcp\\Server\\ServerBuilder\:\:addPrompt\(\) has parameter \$handler with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
@ -443,6 +366,24 @@ parameters:
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Method Mcp\\Server\\ServerBuilder\:\:getCompletionProviders\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Method Mcp\\Server\\ServerBuilder\:\:setDiscovery\(\) has parameter \$excludeDirs with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Method Mcp\\Server\\ServerBuilder\:\:setDiscovery\(\) has parameter \$scanDirs with no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Property Mcp\\Server\\ServerBuilder\:\:\$discoveryExcludeDirs type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
@ -455,6 +396,18 @@ parameters:
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Property Mcp\\Server\\ServerBuilder\:\:\$paginationLimit \(int\|null\) is never assigned null so it can be removed from the property type\.$#'
identifier: property.unusedType
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Property Mcp\\Server\\ServerBuilder\:\:\$paginationLimit is never read, only written\.$#'
identifier: property.onlyWritten
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Property Mcp\\Server\\ServerBuilder\:\:\$prompts type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
@ -478,15 +431,3 @@ parameters:
identifier: missingType.iterableValue
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Property Mcp\\Server\\ServerBuilder\:\:\$paginationLimit \(int\|null\) is never assigned null so it can be removed from the property type\.$#'
identifier: property.unusedType
count: 1
path: src/Server/ServerBuilder.php
-
message: '#^Property Mcp\\Server\\ServerBuilder\:\:\$paginationLimit is never read, only written\.$#'
identifier: property.onlyWritten
count: 1
path: src/Server/ServerBuilder.php