Skip to content

Commit

Permalink
Run lint with newest Pint release
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrisandro committed Dec 6, 2023
1 parent 614d9c9 commit 049aa14
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/OpenAI.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class OpenAI
/**
* Creates a new Open AI Client with the given API token.
*/
public static function client(string $apiKey, string $organization = null): Client
public static function client(string $apiKey, ?string $organization = null): Client
{
return self::factory()
->withApiKey($apiKey)
Expand Down
2 changes: 1 addition & 1 deletion src/Responses/Audio/SpeechStreamResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function meta(): MetaInformation
return MetaInformation::from($this->response->getHeaders());
}

public static function fake(string $content = null, MetaInformation $meta = null): static
public static function fake(?string $content = null, ?MetaInformation $meta = null): static
{
$psr17Factory = new Psr17Factory();
$response = $psr17Factory->createResponse()
Expand Down
6 changes: 3 additions & 3 deletions src/Testing/ClientFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function addResponses(array $responses): void
$this->responses = [...$this->responses, ...$responses];
}

public function assertSent(string $resource, callable|int $callback = null): void
public function assertSent(string $resource, callable|int|null $callback = null): void
{
if (is_int($callback)) {
$this->assertSentTimes($resource, $callback);
Expand All @@ -72,7 +72,7 @@ private function assertSentTimes(string $resource, int $times = 1): void
/**
* @return mixed[]
*/
private function sent(string $resource, callable $callback = null): array
private function sent(string $resource, ?callable $callback = null): array
{
if (! $this->hasSent($resource)) {
return [];
Expand All @@ -88,7 +88,7 @@ private function hasSent(string $resource): bool
return $this->resourcesOf($resource) !== [];
}

public function assertNotSent(string $resource, callable $callback = null): void
public function assertNotSent(string $resource, ?callable $callback = null): void
{
PHPUnit::assertCount(
0, $this->sent($resource, $callback),
Expand Down
4 changes: 2 additions & 2 deletions src/Testing/Resources/Concerns/Testable.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ protected function record(string $method, array $args = []): ResponseContract|Re
return $this->fake->record(new TestRequest($this->resource(), $method, $args));
}

public function assertSent(callable|int $callback = null): void
public function assertSent(callable|int|null $callback = null): void
{
$this->fake->assertSent($this->resource(), $callback);
}

public function assertNotSent(callable|int $callback = null): void
public function assertNotSent(callable|int|null $callback = null): void
{
$this->fake->assertNotSent($this->resource(), $callback);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Testing/Responses/Concerns/Fakeable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trait Fakeable
/**
* @param array<string, mixed> $override
*/
public static function fake(array $override = [], MetaInformation $meta = null): static
public static function fake(array $override = [], ?MetaInformation $meta = null): static
{
$class = str_replace('Responses\\', 'Testing\\Responses\\Fixtures\\', static::class).'Fixture';

Expand Down

0 comments on commit 049aa14

Please sign in to comment.