Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="true"
findUnusedPsalmSuppress="true"
>
<projectFiles>
<directory name="src"/>
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/CreateChatCompletionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -98,6 +99,7 @@ public function testThrowsWhenStatusCodeIsNot200(): void
$this->openAi->createChatCompletion(self::completionRequest());
}

#[Override]
protected function setUp(): void
{
parent::setUp();
Expand Down
5 changes: 4 additions & 1 deletion tests/functional/TestHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 === []) {
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/CreateChatCompletionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,6 +38,7 @@ public function testHappyPath(): void
self::assertSame('42', $response->choices[0]->message->content);
}

#[Override]
protected function setUp(): void
{
parent::setUp();
Expand Down