Skip to content

Commit

Permalink
Merge pull request #1208: Apply risky Code Style rules
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Jan 24, 2025
1 parent 0c7a830 commit 3260c37
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Config/QueueConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function getConnection(string $name): array
$connections = $this->getConnections();

if (!isset($connections[$name])) {
throw new InvalidArgumentException(sprintf('Queue connection with given name `%s` is not defined.', $name));
throw new InvalidArgumentException(\sprintf('Queue connection with given name `%s` is not defined.', $name));
}

if (!isset($connections[$name]['driver'])) {
Expand Down
2 changes: 2 additions & 0 deletions tests/Core/QueueInjectorTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Spiral\Tests\Queue\Core;

use Mockery as m;
Expand Down
10 changes: 5 additions & 5 deletions tests/Interceptor/Push/CoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testCallActionWithNullOptions(mixed $payload): void

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


$tracer->shouldReceive('getContext')->once()->andReturn(['foo' => ['bar']]);
$tracer->shouldReceive('trace')->once()->andReturnUsing(fn($name, $callback) => $callback());
$tracer->shouldReceive('trace')->once()->andReturnUsing(static fn($name, $callback) => $callback());

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

ContainerScope::runScope($container, function () use ($core): void {
ContainerScope::runScope($container, static function () use ($core): void {
$core->callAction('foo', 'bar', [
'id' => 'job-id',
'payload' => ['baz' => 'baf'],
Expand All @@ -113,7 +113,7 @@ public function testCallWithTracerContextWitoutOptionsWithHeadersSupport(): void
$tracer->shouldNotReceive('getContext');

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

Expand Down
2 changes: 1 addition & 1 deletion tests/Job/CallableJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testPayloadCallbackValueShouldBeClosure(): void

public function testHandle(): void
{
$callback = function (string $name, string $id, ContainerInterface $container): void {
$callback = static function (string $name, string $id, ContainerInterface $container): void {
self::assertSame('foo', $name);
self::assertSame('foo-id', $id);
self::assertInstanceOf(Container::class, $container);
Expand Down

0 comments on commit 3260c37

Please sign in to comment.