Use phpstan/phpstan-phpunit

This commit is contained in:
Vincent Langlet
2025-12-21 21:11:29 +01:00
committed by Oskar Stark
parent 2b14040255
commit c9d75f646b
3 changed files with 12 additions and 2 deletions

View File

@@ -38,6 +38,9 @@ final class AssistantMessageNormalizerTest extends TestCase
$this->assertSame([AssistantMessage::class => true], $normalizer->getSupportedTypes(null));
}
/**
* @param array{role: 'assistant', content: string|list<array{type: 'tool_use', id: string, name: string, input: array<string, mixed>|\stdClass}>} $expectedOutput
*/
#[DataProvider('normalizeDataProvider')]
public function testNormalize(AssistantMessage $message, array $expectedOutput)
{

View File

@@ -31,6 +31,7 @@
},
"require-dev": {
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^11.5.46"
},

View File

@@ -1,4 +1,5 @@
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- ../../../../../.phpstan/extension.neon
parameters:
@@ -14,10 +15,15 @@ parameters:
message: "#^Method .*::test.*\\(\\) has no return type specified\\.$#"
reportUnmatched: false
-
identifier: missingType.iterableValue
path: Tests/*
message: '#^Call to( static)? method PHPUnit\\Framework\\Assert::.* will always evaluate to true\.$#'
reportUnmatched: false
-
identifier: 'symfonyAi.forbidNativeException'
path: Tests/*
reportUnmatched: false
services:
- # Conditionally enabled by bleeding edge in phpstan/phpstan-phpunit 2.x
class: PHPStan\Type\PHPUnit\DataProviderReturnTypeIgnoreExtension
tags:
- phpstan.ignoreErrorExtension