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

@ -161,10 +161,10 @@ class RegistryProviderTest extends TestCase
$tools = $this->registry->getTools();
$this->assertCount(2, $tools);
$this->assertArrayHasKey('tool1', $tools);
$this->assertArrayHasKey('tool2', $tools);
$this->assertInstanceOf(Tool::class, $tools['tool1']);
$this->assertInstanceOf(Tool::class, $tools['tool2']);
$this->assertArrayHasKey('tool1', $tools->references);
$this->assertArrayHasKey('tool2', $tools->references);
$this->assertInstanceOf(Tool::class, $tools->references['tool1']);
$this->assertInstanceOf(Tool::class, $tools->references['tool2']);
}
public function testGetResourcesReturnsAllRegisteredResources(): void
@ -177,10 +177,10 @@ class RegistryProviderTest extends TestCase
$resources = $this->registry->getResources();
$this->assertCount(2, $resources);
$this->assertArrayHasKey('test://resource1', $resources);
$this->assertArrayHasKey('test://resource2', $resources);
$this->assertInstanceOf(Resource::class, $resources['test://resource1']);
$this->assertInstanceOf(Resource::class, $resources['test://resource2']);
$this->assertArrayHasKey('test://resource1', $resources->references);
$this->assertArrayHasKey('test://resource2', $resources->references);
$this->assertInstanceOf(Resource::class, $resources->references['test://resource1']);
$this->assertInstanceOf(Resource::class, $resources->references['test://resource2']);
}
public function testGetPromptsReturnsAllRegisteredPrompts(): void
@ -193,10 +193,10 @@ class RegistryProviderTest extends TestCase
$prompts = $this->registry->getPrompts();
$this->assertCount(2, $prompts);
$this->assertArrayHasKey('prompt1', $prompts);
$this->assertArrayHasKey('prompt2', $prompts);
$this->assertInstanceOf(Prompt::class, $prompts['prompt1']);
$this->assertInstanceOf(Prompt::class, $prompts['prompt2']);
$this->assertArrayHasKey('prompt1', $prompts->references);
$this->assertArrayHasKey('prompt2', $prompts->references);
$this->assertInstanceOf(Prompt::class, $prompts->references['prompt1']);
$this->assertInstanceOf(Prompt::class, $prompts->references['prompt2']);
}
public function testGetResourceTemplatesReturnsAllRegisteredTemplates(): void
@ -209,10 +209,10 @@ class RegistryProviderTest extends TestCase
$templates = $this->registry->getResourceTemplates();
$this->assertCount(2, $templates);
$this->assertArrayHasKey('test1://{id}', $templates);
$this->assertArrayHasKey('test2://{category}', $templates);
$this->assertInstanceOf(ResourceTemplate::class, $templates['test1://{id}']);
$this->assertInstanceOf(ResourceTemplate::class, $templates['test2://{category}']);
$this->assertArrayHasKey('test1://{id}', $templates->references);
$this->assertArrayHasKey('test2://{category}', $templates->references);
$this->assertInstanceOf(ResourceTemplate::class, $templates->references['test1://{id}']);
$this->assertInstanceOf(ResourceTemplate::class, $templates->references['test2://{category}']);
}
public function testHasElementsReturnsFalseForEmptyRegistry(): void