@@ -40,7 +40,7 @@ |
||
40 | 40 | $finalizer->shouldReceive('addFinalizer')->once(); |
41 | 41 | |
42 | 42 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
43 | - new class() implements LoaderInterface { |
|
43 | + new class() implements LoaderInterface{ |
|
44 | 44 | public function has(string $section): bool |
45 | 45 | { |
46 | 46 | return false; |
@@ -40,7 +40,8 @@ |
||
40 | 40 | $finalizer->shouldReceive('addFinalizer')->once(); |
41 | 41 | |
42 | 42 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
43 | - new class() implements LoaderInterface { |
|
43 | + new class() implements LoaderInterface |
|
44 | + { |
|
44 | 45 | public function has(string $section): bool |
45 | 46 | { |
46 | 47 | return false; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $finalizer->shouldReceive('addFinalizer')->once(); |
33 | 33 | |
34 | 34 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
35 | - new class() implements LoaderInterface { |
|
35 | + new class() implements LoaderInterface{ |
|
36 | 36 | public function has(string $section): bool |
37 | 37 | { |
38 | 38 | return false; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ] |
84 | 84 | ])); |
85 | 85 | |
86 | - $logger = $this->container->get(LogsInterface::class)->getLogger('test');; |
|
86 | + $logger = $this->container->get(LogsInterface::class)->getLogger('test'); ; |
|
87 | 87 | |
88 | 88 | $this->assertCount(1, $logger->getProcessors()); |
89 | 89 | $this->assertInstanceOf(PsrLogMessageProcessor::class, $logger->getProcessors()[0]); |
@@ -40,7 +40,8 @@ |
||
40 | 40 | $finalizer->shouldReceive('addFinalizer')->once(); |
41 | 41 | |
42 | 42 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
43 | - new class() implements LoaderInterface { |
|
43 | + new class() implements LoaderInterface |
|
44 | + { |
|
44 | 45 | public function has(string $section): bool |
45 | 46 | { |
46 | 47 | return false; |
@@ -20,11 +20,13 @@ |
||
20 | 20 | |
21 | 21 | public function handle(string $name, string $id, array $payload): void |
22 | 22 | { |
23 | - if (!isset($payload['callback'])) { |
|
23 | + if (!isset($payload['callback'])) |
|
24 | + { |
|
24 | 25 | throw new InvalidArgumentException('Payload `callback` key is required.'); |
25 | 26 | } |
26 | 27 | |
27 | - if (!$payload['callback'] instanceof \Closure) { |
|
28 | + if (!$payload['callback'] instanceof \Closure) |
|
29 | + { |
|
28 | 30 | throw new InvalidArgumentException('Payload `callback` key value type should be a closure.'); |
29 | 31 | } |
30 | 32 |
@@ -12,16 +12,16 @@ |
||
12 | 12 | { |
13 | 13 | public function __construct( |
14 | 14 | private readonly InvokerInterface $invoker |
15 | - ) { |
|
15 | + ){ |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function handle(string $name, string $id, array $payload): void |
19 | 19 | { |
20 | - if (!isset($payload['callback'])) { |
|
20 | + if (!isset($payload['callback'])){ |
|
21 | 21 | throw new InvalidArgumentException('Payload `callback` key is required.'); |
22 | 22 | } |
23 | 23 | |
24 | - if (!$payload['callback'] instanceof \Closure) { |
|
24 | + if (!$payload['callback'] instanceof \Closure){ |
|
25 | 25 | throw new InvalidArgumentException('Payload `callback` key value type should be a closure.'); |
26 | 26 | } |
27 | 27 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | 'sync' => $this->defaultQueue, |
87 | 87 | 'test' => new TestQueueClass(), |
88 | 88 | ][$name] ?? null; |
89 | - if ($result === null) { |
|
89 | + if ($result === null){ |
|
90 | 90 | throw new NotFoundException(); |
91 | 91 | } |
92 | 92 | return $result; |
@@ -86,7 +86,8 @@ |
||
86 | 86 | 'sync' => $this->defaultQueue, |
87 | 87 | 'test' => new TestQueueClass(), |
88 | 88 | ][$name] ?? null; |
89 | - if ($result === null) { |
|
89 | + if ($result === null) |
|
90 | + { |
|
90 | 91 | throw new NotFoundException(); |
91 | 92 | } |
92 | 93 | return $result; |
@@ -29,7 +29,8 @@ discard block |
||
29 | 29 | // Replaces alias with real pipeline name |
30 | 30 | $name = $this->config->getAliases()[$name] ?? $name; |
31 | 31 | |
32 | - if (!isset($this->pipelines[$name])) { |
|
32 | + if (!isset($this->pipelines[$name])) |
|
33 | + { |
|
33 | 34 | $this->pipelines[$name] = $this->resolveConnection($name); |
34 | 35 | } |
35 | 36 | |
@@ -44,9 +45,12 @@ discard block |
||
44 | 45 | { |
45 | 46 | $config = $this->config->getConnection($name); |
46 | 47 | |
47 | - try { |
|
48 | + try |
|
49 | + { |
|
48 | 50 | return $this->factory->make($config['driver'], $config); |
49 | - } catch (ContainerException $e) { |
|
51 | + } |
|
52 | + catch (ContainerException $e) |
|
53 | + { |
|
50 | 54 | throw new Exception\NotSupportedDriverException( |
51 | 55 | \sprintf( |
52 | 56 | 'Driver `%s` is not supported. Connection `%s` cannot be created. Reason: `%s`', |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function __construct( |
17 | 17 | private readonly QueueConfig $config, |
18 | 18 | private readonly FactoryInterface $factory, |
19 | - ) { |
|
19 | + ){ |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function getConnection(?string $name = null): QueueInterface |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | // Replaces alias with real pipeline name |
26 | 26 | $name = $this->config->getAliases()[$name] ?? $name; |
27 | 27 | |
28 | - if (!isset($this->pipelines[$name])) { |
|
28 | + if (!isset($this->pipelines[$name])){ |
|
29 | 29 | $this->pipelines[$name] = $this->resolveConnection($name); |
30 | 30 | } |
31 | 31 | |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | { |
41 | 41 | $config = $this->config->getConnection($name); |
42 | 42 | |
43 | - try { |
|
43 | + try{ |
|
44 | 44 | return $this->factory->make($config['driver'], $config); |
45 | - } catch (ContainerException $e) { |
|
45 | + }catch (ContainerException $e){ |
|
46 | 46 | throw new Exception\NotSupportedDriverException( |
47 | 47 | \sprintf( |
48 | 48 | 'Driver `%s` is not supported. Connection `%s` cannot be created. Reason: `%s`', |
@@ -38,8 +38,10 @@ |
||
38 | 38 | public function locateCommands(): array |
39 | 39 | { |
40 | 40 | $commands = []; |
41 | - foreach ($this->classes->getScopedClasses('consoleCommands', SymfonyCommand::class) as $class) { |
|
42 | - if ($class->isAbstract()) { |
|
41 | + foreach ($this->classes->getScopedClasses('consoleCommands', SymfonyCommand::class) as $class) |
|
42 | + { |
|
43 | + if ($class->isAbstract()) |
|
44 | + { |
|
43 | 45 | continue; |
44 | 46 | } |
45 | 47 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | private readonly ScopedClassesInterface $classes, |
18 | 18 | ContainerInterface $container, |
19 | 19 | array $interceptors = [], |
20 | - ) { |
|
20 | + ){ |
|
21 | 21 | $this->container = $container; |
22 | 22 | $this->interceptors = $interceptors; |
23 | 23 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | public function locateCommands(): array |
26 | 26 | { |
27 | 27 | $commands = []; |
28 | - foreach ($this->classes->getScopedClasses('consoleCommands', SymfonyCommand::class) as $class) { |
|
29 | - if ($class->isAbstract()) { |
|
28 | + foreach ($this->classes->getScopedClasses('consoleCommands', SymfonyCommand::class) as $class){ |
|
29 | + if ($class->isAbstract()){ |
|
30 | 30 | continue; |
31 | 31 | } |
32 | 32 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | 'directories' => [], |
48 | 48 | 'scopes' => [ |
49 | 49 | 'prototypes' => [ |
50 | - 'directories' => [__DIR__ . '/Fixtures'] |
|
50 | + 'directories' => [__DIR__.'/Fixtures'] |
|
51 | 51 | ] |
52 | 52 | ] |
53 | 53 | ]))); |
@@ -76,7 +76,7 @@ |
||
76 | 76 | 'test' => $this->defaultCache, |
77 | 77 | 'array' => new ArrayStorage(), |
78 | 78 | ][$name] ?? null; |
79 | - if ($result === null) { |
|
79 | + if ($result === null){ |
|
80 | 80 | throw new NotFoundException(); |
81 | 81 | } |
82 | 82 | return $result; |
@@ -76,7 +76,8 @@ |
||
76 | 76 | 'test' => $this->defaultCache, |
77 | 77 | 'array' => new ArrayStorage(), |
78 | 78 | ][$name] ?? null; |
79 | - if ($result === null) { |
|
79 | + if ($result === null) |
|
80 | + { |
|
80 | 81 | throw new NotFoundException(); |
81 | 82 | } |
82 | 83 | return $result; |
@@ -48,7 +48,8 @@ |
||
48 | 48 | |
49 | 49 | public function testRewindAfterRead(): void |
50 | 50 | { |
51 | - if (PHP_VERSION_ID < 80000) { |
|
51 | + if (PHP_VERSION_ID < 80000) |
|
52 | + { |
|
52 | 53 | $this->markTestSkipped('See issue https://bugs.php.net/bug.php?id=79927.'); |
53 | 54 | } |
54 | 55 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | public function testRewindAfterRead(): void |
50 | 50 | { |
51 | - if (PHP_VERSION_ID < 80000) { |
|
51 | + if (PHP_VERSION_ID < 80000){ |
|
52 | 52 | $this->markTestSkipped('See issue https://bugs.php.net/bug.php?id=79927.'); |
53 | 53 | } |
54 | 54 | |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | $rValue = 'return-value'; |
104 | 104 | $stream = $this->createStream(self::DEFAULT_SEQUENCE, $rValue); |
105 | 105 | |
106 | - $result = (string) $stream; |
|
106 | + $result = (string)$stream; |
|
107 | 107 | |
108 | - $this->assertSame(self::DEFAULT_CONTENT_RESULT . $rValue, $result); |
|
108 | + $this->assertSame(self::DEFAULT_CONTENT_RESULT.$rValue, $result); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | public function testToStringWithReturnOnly(): void |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $rValue = 'return-value'; |
114 | 114 | $stream = $this->createStream([], $rValue); |
115 | 115 | |
116 | - $result = (string) $stream; |
|
116 | + $result = (string)$stream; |
|
117 | 117 | |
118 | 118 | $this->assertSame($rValue, $result); |
119 | 119 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $stream = $this->createStream(); |
124 | 124 | $stream->close(); |
125 | 125 | |
126 | - $this->assertSame('', (string) $stream); |
|
126 | + $this->assertSame('', (string)$stream); |
|
127 | 127 | |
128 | 128 | $this->expectException(RuntimeException::class); |
129 | 129 | $this->expectErrorMessage('Unable to read stream contents.'); |