Skip to content

Commit 7ae8782

Browse files
committed
CS fix
1 parent ea042a6 commit 7ae8782

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

src/McpServer/Prompt/Extension/TemplateResolver.php

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ private function substituteMessages(array $messages, array $arguments): array
131131
$resolver = $this->variableResolver->with(new VariableReplacementProcessor($variableProvider, $this->logger));
132132

133133
foreach ($messages as $message) {
134+
\assert($message->content instanceof TextContent);
134135
$content = $message->content->text;
135136
$substitutedContent = $resolver->resolve($content);
136137

src/McpServer/Prompt/PromptRegistry.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,23 @@ public function register(PromptDefinition $prompt): void
2727
$this->prompts[$prompt->id] = $prompt;
2828
}
2929

30-
public function get(string $id): PromptDefinition
30+
public function get(string $name): PromptDefinition
3131
{
32-
if (!$this->has($id)) {
32+
if (!$this->has($name)) {
3333
throw new \InvalidArgumentException(
3434
\sprintf(
3535
'No prompt with the name "%s" exists',
36-
$id,
36+
$name,
3737
),
3838
);
3939
}
4040

41-
return $this->prompts[$id];
41+
return $this->prompts[$name];
4242
}
4343

44-
public function has(string $id): bool
44+
public function has(string $name): bool
4545
{
46-
return isset($this->prompts[$id]);
46+
return isset($this->prompts[$name]);
4747
}
4848

4949
public function all(): array

src/McpServer/Prompt/PromptRegistryInterface.php

-15
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,4 @@ interface PromptRegistryInterface
1212
* Registers a prompt in the registry.
1313
*/
1414
public function register(PromptDefinition $prompt): void;
15-
16-
/**
17-
* Checks if the registry has a prompt with the given ID.
18-
*
19-
* @param string $id The prompt ID
20-
*/
21-
public function has(string $id): bool;
22-
23-
/**
24-
* Gets a prompt by ID.
25-
*
26-
* @param string $id The prompt ID
27-
* @throws \InvalidArgumentException If no prompt with the given ID exists
28-
*/
29-
public function get(string $id): PromptDefinition;
3015
}

0 commit comments

Comments
 (0)