Skip to content

Commit

Permalink
refactor: Add ArrowFunction return type #1183
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Jan 1, 2025
1 parent 1a93203 commit 1efa8d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ContainerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getHandler(string $jobType): HandlerInterface
private function className(string $jobType): string
{
$names = \explode('.', $jobType);
$names = \array_map(fn (string $value) => $this->inflector->classify($value), $names);
$names = \array_map(fn (string $value): string => $this->inflector->classify($value), $names);

return \implode('\\', $names);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Interceptor/Push/CoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testCallActionWithNullOptions(mixed $payload): void
}

$queue->shouldReceive('push')->once()
->withArgs(fn(string $name, mixed $p = [], ?OptionsInterface $options = null) => $name === 'foo'
->withArgs(fn(string $name, mixed $p = [], ?OptionsInterface $options = null): bool => $name === 'foo'
&& $payload === $p
&& $options instanceof Options,
);
Expand Down Expand Up @@ -80,7 +80,7 @@ public function testCallWithTracerContext(): void
$tracer->shouldReceive('trace')->once()->andReturnUsing(fn($name, $callback) => $callback());

$queue->shouldReceive('push')->once()
->withArgs(fn(string $name, array $payload = [], ?OptionsInterface $options = null) => $name === 'foo'
->withArgs(fn(string $name, array $payload = [], ?OptionsInterface $options = null): bool => $name === 'foo'
&& $payload === ['baz' => 'baf']
&& $options->getHeader('foo') === ['bar']);

Expand All @@ -103,7 +103,7 @@ public function testCallWithTracerContextWitoutOptionsWithHeadersSupport(): void
$tracer->shouldNotReceive('getContext');

$queue->shouldReceive('push')->once()
->withArgs(fn(string $name, array $payload = [], ?OptionsInterface $options = null) => $name === 'foo'
->withArgs(fn(string $name, array $payload = [], ?OptionsInterface $options = null): bool => $name === 'foo'
&& $payload === ['baz' => 'baf']
&& $options !== null);

Expand Down

0 comments on commit 1efa8d4

Please sign in to comment.