Skip to content

Commit 17e0cfa

Browse files
committed
[Platform] Add PHPStan array type annotations to more bridge tests
1 parent 09f473a commit 17e0cfa

File tree

7 files changed

+27
-0
lines changed

7 files changed

+27
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ 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+
*/
7884
#[DataProvider('payloadTestCases')]
7985
public function testGetPayloadForDifferentInputsAndTasks(object|array|string $input, array $options, array $expectedKeys, array $expectedValues = [])
8086
{

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

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

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

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

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

3131
class MessageBagNormalizerTest extends TestCase
3232
{
33+
/**
34+
* @param array<string, mixed> $expected
35+
*/
3336
#[DataProvider('normalizeProvider')]
3437
public function testNormalize(MessageBag $messageBag, array $expected)
3538
{

src/platform/src/Bridge/OpenAi/Tests/Contract/Gpt/ToolNormalizerTest.php

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

2525
class ToolNormalizerTest extends TestCase
2626
{
27+
/**
28+
* @param array<string, mixed> $expected
29+
*/
2730
#[DataProvider('normalizeProvider')]
2831
public function testNormalize(array $expected, Tool $tool)
2932
{

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

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

135+
/**
136+
* @param array<string, mixed> $data
137+
*/
135138
private function createRawResult(array $data = []): RawHttpResult
136139
{
137140
$rawResponse = $this->createStub(ResponseInterface::class);

src/platform/src/Bridge/Perplexity/Tests/Contract/FileUrlNormalizerTest.php

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

44+
/**
45+
* @param array<string, mixed> $expected
46+
*/
4447
#[DataProvider('normalizeDataProvider')]
4548
public function testNormalize(DocumentUrl $document, array $expected)
4649
{
@@ -51,6 +54,9 @@ public function testNormalize(DocumentUrl $document, array $expected)
5154
$this->assertEquals($expected, $normalized);
5255
}
5356

57+
/**
58+
* @return iterable<array{0: DocumentUrl, 1: array<string, mixed>}>
59+
*/
5460
public static function normalizeDataProvider(): iterable
5561
{
5662
yield 'document from file url' => [

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

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

112+
/**
113+
* @param array<string, mixed> $data
114+
*/
112115
private function createRawResult(array $data = []): RawHttpResult
113116
{
114117
$rawResponse = $this->createStub(ResponseInterface::class);

0 commit comments

Comments
 (0)