Skip to content

Commit b049476

Browse files
committed
[Platform] Remove PHPStan array type annotations from bridge tests
The phpstan.dist.neon now ignores missingType.iterableValue for src/Bridge/**/Tests/* paths, making these annotations unnecessary. 🤖 Generated with [Claude Code](https://claude.ai/code)
1 parent ee13a67 commit b049476

15 files changed

+0
-74
lines changed

src/platform/src/Bridge/HuggingFace/Tests/ModelClientTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ public static function urlTestCases(): \Iterator
7575
];
7676
}
7777

78-
/**
79-
* @param array<string, mixed> $input
80-
* @param array<string, mixed> $options
81-
* @param array<int, string> $expectedKeys
82-
* @param array<string, mixed> $expectedValues
83-
*/
8478
#[DataProvider('payloadTestCases')]
8579
public function testGetPayloadForDifferentInputsAndTasks(object|array|string $input, array $options, array $expectedKeys, array $expectedValues = [])
8680
{

src/platform/src/Bridge/HuggingFace/Tests/Output/ClassificationResultTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ public function testFromArrayPreservesOrder()
108108
$this->assertSame('third', $result->classifications[2]->label);
109109
}
110110

111-
/**
112-
* @param array{label: string, score: float} $classification
113-
*/
114111
#[TestDox('fromArray handles various label formats')]
115112
#[TestWith([['label' => '', 'score' => 0.5]])]
116113
#[TestWith([['label' => 'UPPERCASE', 'score' => 0.5]])]

src/platform/src/Bridge/HuggingFace/Tests/Output/QuestionAnsweringResultTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ public function testFromArray()
6868
$this->assertSame(0.87, $result->score);
6969
}
7070

71-
/**
72-
* @param array{answer: string, start: int, end: int, score: float} $data
73-
*/
7471
#[TestDox('fromArray handles various data formats')]
7572
#[TestWith([['answer' => 'Yes', 'start' => 0, 'end' => 3, 'score' => 1.0]])]
7673
#[TestWith([['answer' => 'No answer found', 'start' => -1, 'end' => -1, 'score' => 0.0]])]

src/platform/src/Bridge/HuggingFace/Tests/Output/SentenceSimilarityResultTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ public function testConstructionWithEmptyArray()
4040
$this->assertCount(0, $result->similarities);
4141
}
4242

43-
/**
44-
* @param array<int, float> $similarities
45-
*/
4643
#[TestDox('Constructor accepts various similarity arrays')]
4744
#[TestWith([[0.5]])]
4845
#[TestWith([[0.0, 1.0]])]
@@ -73,9 +70,6 @@ public function testFromArray()
7370
$this->assertSame(0.23, $result->similarities[3]);
7471
}
7572

76-
/**
77-
* @param array<int, float> $data
78-
*/
7973
#[TestDox('fromArray handles various data formats')]
8074
#[TestWith([[]])] // Empty array
8175
#[TestWith([[0.999]])] // Single high similarity
@@ -96,9 +90,6 @@ public function testFromArrayWithVariousData(array $data)
9690
}
9791
}
9892

99-
/**
100-
* @param array<int, float> $similarities
101-
*/
10293
#[TestDox('Special float values are handled correctly')]
10394
#[TestWith([[0.0, 1.0, 0.5]])] // Boundary values
10495
#[TestWith([[-1.0, 2.0]])] // Outside normal range

src/platform/src/Bridge/HuggingFace/Tests/Output/TableQuestionAnsweringResultTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ public function testConstructionWithAllParameters()
4747
$this->assertSame($aggregator, $result->aggregator);
4848
}
4949

50-
/**
51-
* @param array<int, array<int, int>> $coordinates
52-
* @param array<int, int|string> $cells
53-
* @param array<int, string> $aggregator
54-
*/
5550
#[TestDox('Constructor accepts various parameter combinations')]
5651
#[TestWith(['Yes', [], [], []])]
5752
#[TestWith(['No', [[0, 1]], ['A1'], ['COUNT']])]
@@ -99,9 +94,6 @@ public function testFromArrayWithAllFields()
9994
$this->assertSame(['SUM'], $result->aggregator);
10095
}
10196

102-
/**
103-
* @param array<string, mixed> $data
104-
*/
10597
#[TestDox('fromArray handles optional fields with default values')]
10698
#[TestWith([['answer' => 'Test', 'coordinates' => [[0, 0], [1, 1]]]])]
10799
#[TestWith([['answer' => 'Test', 'cells' => ['A1', 'B1']]])]
@@ -138,9 +130,6 @@ public function testFromArrayWithVariousCellTypes()
138130
$this->assertSame(['NONE'], $result->aggregator);
139131
}
140132

141-
/**
142-
* @param array<string, mixed> $data
143-
*/
144133
#[TestDox('fromArray handles various aggregator formats')]
145134
#[TestWith([['answer' => 'Test', 'aggregator' => []]])]
146135
#[TestWith([['answer' => 'Test', 'aggregator' => ['NONE']]])]

src/platform/src/Bridge/Mistral/Tests/TokenOutputProcessorTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ public function testItHandlesMissingUsageFields()
127127
$this->assertNull($tokenUsage->totalTokens);
128128
}
129129

130-
/**
131-
* @param array<string, mixed> $data
132-
*/
133130
private function createRawResponse(array $data = []): RawHttpResult
134131
{
135132
$rawResponse = $this->createStub(ResponseInterface::class);

src/platform/src/Bridge/Ollama/Tests/Contract/AssistantMessageNormalizerTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ public function testGetSupportedTypes()
4646
$this->assertSame([AssistantMessage::class => true], $this->normalizer->getSupportedTypes(null));
4747
}
4848

49-
/**
50-
* @param array<string, mixed> $expectedOutput
51-
*/
5249
#[DataProvider('normalizeDataProvider')]
5350
public function testNormalize(AssistantMessage $message, array $expectedOutput)
5451
{
@@ -57,9 +54,6 @@ public function testNormalize(AssistantMessage $message, array $expectedOutput)
5754
$this->assertEquals($expectedOutput, $normalized);
5855
}
5956

60-
/**
61-
* @return iterable<string, array{AssistantMessage, array{role: Role::Assistant, tool_calls: list<array{type: string, function: array{name: string, arguments: mixed}}>}}>
62-
*/
6357
public static function normalizeDataProvider(): iterable
6458
{
6559
yield 'assistant message without tool calls' => [

src/platform/src/Bridge/Ollama/Tests/OllamaResultConverterTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,13 @@ public function testConvertThinkingStreamingResponse()
217217
$this->assertArrayHasKey('total_duration', $chunks->current()->raw);
218218
}
219219

220-
/**
221-
* @return iterable<array<string, mixed>>
222-
*/
223220
private function generateConvertStreamingStream(): iterable
224221
{
225222
yield ['model' => 'deepseek-r1:latest', 'created_at' => '2025-10-29T17:15:49.631700779Z', 'message' => ['role' => 'assistant', 'content' => 'Hello'], 'done' => false];
226223
yield ['model' => 'deepseek-r1:latest', 'created_at' => '2025-10-29T17:15:49.905924913Z', 'message' => ['role' => 'assistant', 'content' => ' world!'], 'done' => true,
227224
'done_reason' => 'stop', 'total_duration' => 100, 'load_duration' => 10, 'prompt_eval_count' => 42, 'prompt_eval_duration' => 30, 'eval_count' => 17, 'eval_duration' => 60];
228225
}
229226

230-
/**
231-
* @return iterable<array<string, mixed>>
232-
*/
233227
private function generateConvertThinkingStreamingStream(): iterable
234228
{
235229
yield ['model' => 'deepseek-r1:latest', 'created_at' => '2025-10-29T17:15:49.631700779Z', 'message' => ['role' => 'assistant', 'content' => '', 'thinking' => 'Thinking'], 'done' => false];

src/platform/src/Bridge/OpenAi/Tests/Contract/DocumentNormalizerTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public function testGetSupportedTypes()
4141
$this->assertSame($expected, $normalizer->getSupportedTypes(null));
4242
}
4343

44-
/**
45-
* @param array<string, mixed> $expected
46-
*/
4744
#[DataProvider('normalizeDataProvider')]
4845
public function testNormalize(Document $document, array $expected)
4946
{
@@ -54,9 +51,6 @@ public function testNormalize(Document $document, array $expected)
5451
$this->assertEquals($expected, $normalized);
5552
}
5653

57-
/**
58-
* @return iterable<array{0: Document, 1: array<string, mixed>}>
59-
*/
6054
public static function normalizeDataProvider(): iterable
6155
{
6256
yield 'document from file' => [

src/platform/src/Bridge/OpenAi/Tests/Contract/Gpt/Message/AssistantMessageNormalizerTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727

2828
class AssistantMessageNormalizerTest extends TestCase
2929
{
30-
/**
31-
* @param array<string, mixed> $expected
32-
*/
3330
#[DataProvider('normalizeProvider')]
3431
public function testNormalize(AssistantMessage $message, array $expected)
3532
{

0 commit comments

Comments
 (0)