Fix & clean up examples (#78)

This commit is contained in:
Christopher Hertel 2025-09-24 21:50:06 +02:00 • committed by GitHub
commit 8defd9b17f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,12 +13,12 @@ namespace Mcp\Example\HttpUserProfileExample;
use Mcp\Capability\Prompt\Completion\ProviderInterface;
class UserIdCompletionProvider implements ProviderInterface
final class UserIdCompletionProvider implements ProviderInterface
{
private const AVAILABLE_USER_IDS = ['101', '102', '103'];
public function getCompletions(string $currentValue): array
{
$availableUserIds = ['101', '102', '103'];
return array_filter($availableUserIds, fn (string $userId) => str_contains($userId, $currentValue));
return array_filter(self::AVAILABLE_USER_IDS, fn (string $userId) => str_contains($userId, $currentValue));
}
}