Skip to content

Commit 1661a6d

Browse files
committed
minor #657 [AI Bundle][MCP Bundle][Platform][Store] Remove useless inline comments from codebase (OskarStark)
This PR was squashed before being merged into the main branch. Discussion ---------- [AI Bundle][MCP Bundle][Platform][Store] Remove useless inline comments from codebase | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | -- | License | MIT Remove redundant inline comments that simply restate what the code is doing, including obvious state transitions in tests, section separators, and workflow comments that don't add meaningful context. Commits ------- b6df2ff [AI Bundle][MCP Bundle][Platform][Store] Remove useless inline comments from codebase
2 parents f4b5a6c + b6df2ff commit 1661a6d

File tree

18 files changed

+0
-72
lines changed

18 files changed

+0
-72
lines changed

src/ai-bundle/src/Command/ChatCommand.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
7979
{
8080
$agentArg = $input->getArgument('agent');
8181

82-
// If agent is already provided and valid, nothing to do
8382
if ($agentArg) {
8483
return;
8584
}
@@ -106,7 +105,6 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
106105

107106
protected function execute(InputInterface $input, OutputInterface $output): int
108107
{
109-
// Initialize agent (moved from initialize() to execute() so it runs after interact())
110108
$availableAgents = array_keys($this->agents->getProvidedServices());
111109

112110
if (0 === \count($availableAgents)) {
@@ -116,19 +114,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
116114
$agentArg = $input->getArgument('agent');
117115
$agentName = \is_string($agentArg) ? $agentArg : '';
118116

119-
// Validate that the agent exists if one was provided
120117
if ($agentName && !$this->agents->has($agentName)) {
121118
throw new InvalidArgumentException(\sprintf('Agent "%s" not found. Available agents: "%s"', $agentName, implode(', ', $availableAgents)));
122119
}
123120

124-
// If we still don't have an agent name at this point, something went wrong
125121
if (!$agentName) {
126122
throw new InvalidArgumentException(\sprintf('Agent name is required. Available agents: "%s"', implode(', ', $availableAgents)));
127123
}
128124

129125
$agent = $this->agents->get($agentName);
130126

131-
// Now start the chat
132127
$io = new SymfonyStyle($input, $output);
133128

134129
$io->title(\sprintf('Chat with %s Agent', $agentName));
@@ -155,7 +150,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
155150
try {
156151
$result = $agent->call($messages);
157152

158-
// Display system prompt after first successful call
159153
if (!$systemPromptDisplayed && null !== ($systemMessage = $messages->getSystemMessage())) {
160154
$io->section('System Prompt');
161155
$io->block($systemMessage->content, null, 'fg=gray', ' ', true);

src/mcp-bundle/tests/DependencyInjection/McpBundleTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,8 @@ public function testDefaultPageSizeConfiguration()
148148
{
149149
$container = $this->buildContainer([]);
150150

151-
// Test that the default page_size parameter is set to 20
152151
$this->assertSame(20, $container->getParameter('mcp.page_size'));
153152

154-
// Test that ToolListHandler is registered
155153
$this->assertTrue($container->hasDefinition('mcp.server.request_handler.tool_list'));
156154

157155
$definition = $container->getDefinition('mcp.server.request_handler.tool_list');
@@ -166,7 +164,6 @@ public function testCustomPageSizeConfiguration()
166164
],
167165
]);
168166

169-
// Test that the custom page_size parameter is set
170167
$this->assertSame(50, $container->getParameter('mcp.page_size'));
171168
}
172169

src/platform/tests/Bridge/Gemini/Contract/MessageBagNormalizerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,9 @@ public function testNormalize(MessageBag $bag, array $expected)
6666
{
6767
$normalizer = new MessageBagNormalizer();
6868

69-
// Set up the inner normalizers
7069
$userMessageNormalizer = new UserMessageNormalizer();
7170
$assistantMessageNormalizer = new AssistantMessageNormalizer();
7271

73-
// Mock a normalizer that delegates to the appropriate concrete normalizer
7472
$mockNormalizer = $this->createMock(NormalizerInterface::class);
7573
$mockNormalizer->method('normalize')
7674
->willReturnCallback(function ($message) use ($userMessageNormalizer, $assistantMessageNormalizer): ?array {

src/platform/tests/Bridge/HuggingFace/Contract/MessageBagNormalizerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ public function testNormalize(MessageBag $bag, array $expected)
5555
{
5656
$normalizer = new MessageBagNormalizer();
5757

58-
// Set up the concrete user message normalizer
5958
$userMessageNormalizer = new UserMessageNormalizer();
6059

61-
// Mock a normalizer that delegates to the concrete normalizer
6260
$mockNormalizer = $this->createMock(NormalizerInterface::class);
6361
$mockNormalizer->method('normalize')
6462
->willReturnCallback(function ($messages) use ($userMessageNormalizer): array {

src/platform/tests/Bridge/HuggingFace/Output/FillMaskResultTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ public function testFromArrayWithVariousFormats()
168168

169169
$this->assertCount(3, $result->fills);
170170

171-
// Test edge cases are properly handled
172171
$this->assertSame(0, $result->fills[0]->token);
173172
$this->assertSame('', $result->fills[0]->tokenStr);
174173
$this->assertSame('', $result->fills[0]->sequence);

src/platform/tests/Bridge/VertexAi/Contract/MessageBagNormalizerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,9 @@ public function testNormalize(MessageBag $bag, array $expected)
6666
{
6767
$normalizer = new MessageBagNormalizer();
6868

69-
// Set up the inner normalizers
7069
$userMessageNormalizer = new UserMessageNormalizer();
7170
$assistantMessageNormalizer = new AssistantMessageNormalizer();
7271

73-
// Mock a normalizer that delegates to the appropriate concrete normalizer
7472
$mockNormalizer = $this->createMock(NormalizerInterface::class);
7573
$mockNormalizer->method('normalize')
7674
->willReturnCallback(function ($message) use ($userMessageNormalizer, $assistantMessageNormalizer): ?array {

src/platform/tests/Bridge/VertexAi/Embeddings/ModelClientTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ final class ModelClientTest extends TestCase
3232
{
3333
public function testItGeneratesTheEmbeddingSuccessfully()
3434
{
35-
// Assert
3635
$expectedResponse = [
3736
'predictions' => [
3837
['embeddings' => ['values' => [0.3, 0.4, 0.4]]],
@@ -44,10 +43,8 @@ public function testItGeneratesTheEmbeddingSuccessfully()
4443

4544
$model = new Model(Model::GEMINI_EMBEDDING_001, ['outputDimensionality' => 1536, 'task_type' => TaskType::CLASSIFICATION]);
4645

47-
// Act
4846
$result = $client->request($model, 'test payload');
4947

50-
// Assert
5148
$this->assertSame($expectedResponse, $result->getData());
5249
}
5350
}

src/platform/tests/Bridge/VertexAi/Embeddings/ResultConverterTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ final class ResultConverterTest extends TestCase
3131
{
3232
public function testItConvertsAResponseToAVectorResult()
3333
{
34-
// Assert
3534
$expectedResponse = [
3635
'predictions' => [
3736
['embeddings' => ['values' => [0.3, 0.4, 0.4]]],

src/platform/tests/Bridge/VertexAi/Gemini/ModelClientTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ final class ModelClientTest extends TestCase
2727
{
2828
public function testItInvokesTheTextModelsSuccessfully()
2929
{
30-
// Arrange
3130
$payload = [
3231
'content' => [
3332
['parts' => ['text' => 'Hello, world!']],
@@ -42,12 +41,10 @@ public function testItInvokesTheTextModelsSuccessfully()
4241

4342
$client = new ModelClient($httpClient, 'global', 'test');
4443

45-
// Act
4644
$result = $client->request(new Model(Model::GEMINI_2_0_FLASH), $payload);
4745
$data = $result->getData();
4846
$info = $result->getObject()->getInfo();
4947

50-
// Assert
5148
$this->assertNotEmpty($data);
5249
$this->assertNotEmpty($info);
5350
$this->assertSame('POST', $info['http_method']);

src/platform/tests/Bridge/VertexAi/Gemini/ResultConverterTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ final class ResultConverterTest extends TestCase
2828
{
2929
public function testItConvertsAResponseToAVectorResult()
3030
{
31-
// Arrange
3231
$payload = [
3332
'content' => ['parts' => [['text' => 'Hello, world!']]],
3433
];
@@ -42,10 +41,8 @@ public function testItConvertsAResponseToAVectorResult()
4241

4342
$resultConverter = new ResultConverter();
4443

45-
// Act
4644
$result = $resultConverter->convert(new RawHttpResult($response));
4745

48-
// Assert
4946
$this->assertInstanceOf(TextResult::class, $result);
5047
$this->assertSame('Hello, world!', $result->getContent());
5148
}

0 commit comments

Comments
 (0)