diff --git a/composer.json b/composer.json index 72fd416..ac79bdb 100644 --- a/composer.json +++ b/composer.json @@ -12,15 +12,15 @@ "require-dev": { "eventjet/coding-standard": "^3.12", "guzzlehttp/guzzle": "^7.9", - "infection/infection": "^0.27.0", - "maglnet/composer-require-checker": "^4.6", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-phpunit": "^1.3", - "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "^10.2", - "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.10" + "infection/infection": "^0.31.2", + "maglnet/composer-require-checker": "^4.16", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^12.3", + "psalm/plugin-phpunit": "^0.19.5", + "vimeo/psalm": "^6.13" }, "config": { "sort-packages": true, diff --git a/psalm.xml b/psalm.xml index 7affeae..8abaff7 100644 --- a/psalm.xml +++ b/psalm.xml @@ -7,6 +7,7 @@ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" findUnusedBaselineEntry="true" findUnusedCode="true" + findUnusedPsalmSuppress="true" > diff --git a/tests/functional/CreateChatCompletionTest.php b/tests/functional/CreateChatCompletionTest.php index 76fbf27..d672f88 100644 --- a/tests/functional/CreateChatCompletionTest.php +++ b/tests/functional/CreateChatCompletionTest.php @@ -14,6 +14,7 @@ use Eventjet\OpenAi\OpenAi; use Eventjet\Test\Functional\OpenAi\TestHttpClient as Http; use GuzzleHttp\Psr7\HttpFactory; +use Override; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -98,6 +99,7 @@ public function testThrowsWhenStatusCodeIsNot200(): void $this->openAi->createChatCompletion(self::completionRequest()); } + #[Override] protected function setUp(): void { parent::setUp(); diff --git a/tests/functional/TestHttpClient.php b/tests/functional/TestHttpClient.php index 7f67176..cb15e2e 100644 --- a/tests/functional/TestHttpClient.php +++ b/tests/functional/TestHttpClient.php @@ -5,10 +5,12 @@ namespace Eventjet\Test\Functional\OpenAi; use LogicException; +use Override; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; +use function array_splice; use function count; use function explode; use function implode; @@ -123,6 +125,7 @@ private static function formatIssues(array $issues): string return implode("\n\n", $formatted); } + #[Override] public function sendRequest(RequestInterface $request): ResponseInterface { if ($this->map === []) { @@ -154,7 +157,7 @@ public function sendRequest(RequestInterface $request): ResponseInterface /** @psalm-suppress PropertyTypeCoercion False positive: It can't become less than 1 here */ $this->map[$index][2]--; } else { - unset($this->map[$index]); + array_splice($this->map, $index, 1); } return $response; } diff --git a/tests/integration/CreateChatCompletionTest.php b/tests/integration/CreateChatCompletionTest.php index 62e2df2..8b213ec 100644 --- a/tests/integration/CreateChatCompletionTest.php +++ b/tests/integration/CreateChatCompletionTest.php @@ -11,6 +11,7 @@ use Eventjet\OpenAi\OpenAi; use GuzzleHttp\Client; use GuzzleHttp\Psr7\HttpFactory; +use Override; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; @@ -37,6 +38,7 @@ public function testHappyPath(): void self::assertSame('42', $response->choices[0]->message->content); } + #[Override] protected function setUp(): void { parent::setUp();