@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function getConsumeInterceptors(): array |
| 53 | 53 | { |
| 54 | - return (array) ($this->config['interceptors']['consume'] ?? []); |
|
| 54 | + return (array)($this->config['interceptors']['consume'] ?? []); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function getPushInterceptors(): array |
| 63 | 63 | { |
| 64 | - return (array) ($this->config['interceptors']['push'] ?? []); |
|
| 64 | + return (array)($this->config['interceptors']['push'] ?? []); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function getDefaultDriver(): string |
| 72 | 72 | { |
| 73 | - if (!\is_string($this->config['default'])) { |
|
| 73 | + if (!\is_string($this->config['default'])){ |
|
| 74 | 74 | throw new InvalidArgumentException('Default queue connection config value must be a string'); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function getDriverAliases(): array |
| 84 | 84 | { |
| 85 | - return (array) ($this->config['driverAliases'] ?? []); |
|
| 85 | + return (array)($this->config['driverAliases'] ?? []); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -92,14 +92,14 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $connections = $this->config['connections'] ?? []; |
| 94 | 94 | |
| 95 | - if ($driver === null) { |
|
| 95 | + if ($driver === null){ |
|
| 96 | 96 | return $connections; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $driverAliases = $this->getDriverAliases(); |
| 100 | 100 | |
| 101 | - if (isset($driverAliases[$driver])) { |
|
| 102 | - if (!\is_string($this->config['driverAliases'][$driver])) { |
|
| 101 | + if (isset($driverAliases[$driver])){ |
|
| 102 | + if (!\is_string($this->config['driverAliases'][$driver])){ |
|
| 103 | 103 | throw new InvalidArgumentException( |
| 104 | 104 | \sprintf('Driver alias for `%s` value must be a string', $driver), |
| 105 | 105 | ); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return \array_filter($connections, static function (array $connection) use ($driverAliases, $driver): bool { |
| 112 | - if (empty($connection['driver'])) { |
|
| 112 | + if (empty($connection['driver'])){ |
|
| 113 | 113 | return false; |
| 114 | 114 | } |
| 115 | 115 | |
@@ -127,28 +127,28 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $connections = $this->getConnections(); |
| 129 | 129 | |
| 130 | - if (!isset($connections[$name])) { |
|
| 130 | + if (!isset($connections[$name])){ |
|
| 131 | 131 | throw new InvalidArgumentException(\sprintf('Queue connection with given name `%s` is not defined.', $name)); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if (!isset($connections[$name]['driver'])) { |
|
| 134 | + if (!isset($connections[$name]['driver'])){ |
|
| 135 | 135 | throw new InvalidArgumentException(\sprintf('Driver for queue connection `%s` is not defined.', $name)); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | $connection = $connections[$name]; |
| 139 | 139 | $driver = $connection['driver']; |
| 140 | 140 | |
| 141 | - if (!\is_string($driver)) { |
|
| 141 | + if (!\is_string($driver)){ |
|
| 142 | 142 | throw new InvalidArgumentException( |
| 143 | 143 | \sprintf('Driver for queue connection `%s` value must be a string', $name), |
| 144 | 144 | ); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - if (isset($this->config['driverAliases'][$driver])) { |
|
| 147 | + if (isset($this->config['driverAliases'][$driver])){ |
|
| 148 | 148 | $connection['driver'] = $this->config['driverAliases'][$driver]; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - if (!\is_string($connection['driver'])) { |
|
| 151 | + if (!\is_string($connection['driver'])){ |
|
| 152 | 152 | throw new InvalidArgumentException( |
| 153 | 153 | \sprintf('Driver alias for queue connection `%s` value must be a string', $name), |
| 154 | 154 | ); |
@@ -162,18 +162,18 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function getRegistryHandlers(): array |
| 164 | 164 | { |
| 165 | - return (array) ($this->config['registry']['handlers'] ?? []); |
|
| 165 | + return (array)($this->config['registry']['handlers'] ?? []); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | public function getRegistrySerializers(): array |
| 169 | 169 | { |
| 170 | - return (array) ($this->config['registry']['serializers'] ?? []); |
|
| 170 | + return (array)($this->config['registry']['serializers'] ?? []); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | 174 | * @psalm-return SerializerInterface|class-string|Autowire|null |
| 175 | 175 | */ |
| 176 | - public function getDefaultSerializer(): SerializerInterface|string|Autowire|null |
|
| 176 | + public function getDefaultSerializer(): SerializerInterface | string | Autowire | null |
|
| 177 | 177 | { |
| 178 | 178 | return $this->config['defaultSerializer'] ?? null; |
| 179 | 179 | } |
@@ -70,7 +70,8 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function getDefaultDriver(): string |
| 72 | 72 | { |
| 73 | - if (!\is_string($this->config['default'])) { |
|
| 73 | + if (!\is_string($this->config['default'])) |
|
| 74 | + { |
|
| 74 | 75 | throw new InvalidArgumentException('Default queue connection config value must be a string'); |
| 75 | 76 | } |
| 76 | 77 | |
@@ -92,14 +93,17 @@ discard block |
||
| 92 | 93 | { |
| 93 | 94 | $connections = $this->config['connections'] ?? []; |
| 94 | 95 | |
| 95 | - if ($driver === null) { |
|
| 96 | + if ($driver === null) |
|
| 97 | + { |
|
| 96 | 98 | return $connections; |
| 97 | 99 | } |
| 98 | 100 | |
| 99 | 101 | $driverAliases = $this->getDriverAliases(); |
| 100 | 102 | |
| 101 | - if (isset($driverAliases[$driver])) { |
|
| 102 | - if (!\is_string($this->config['driverAliases'][$driver])) { |
|
| 103 | + if (isset($driverAliases[$driver])) |
|
| 104 | + { |
|
| 105 | + if (!\is_string($this->config['driverAliases'][$driver])) |
|
| 106 | + { |
|
| 103 | 107 | throw new InvalidArgumentException( |
| 104 | 108 | \sprintf('Driver alias for `%s` value must be a string', $driver), |
| 105 | 109 | ); |
@@ -109,7 +113,8 @@ discard block |
||
| 109 | 113 | } |
| 110 | 114 | |
| 111 | 115 | return \array_filter($connections, static function (array $connection) use ($driverAliases, $driver): bool { |
| 112 | - if (empty($connection['driver'])) { |
|
| 116 | + if (empty($connection['driver'])) |
|
| 117 | + { |
|
| 113 | 118 | return false; |
| 114 | 119 | } |
| 115 | 120 | |
@@ -127,28 +132,33 @@ discard block |
||
| 127 | 132 | { |
| 128 | 133 | $connections = $this->getConnections(); |
| 129 | 134 | |
| 130 | - if (!isset($connections[$name])) { |
|
| 135 | + if (!isset($connections[$name])) |
|
| 136 | + { |
|
| 131 | 137 | throw new InvalidArgumentException(\sprintf('Queue connection with given name `%s` is not defined.', $name)); |
| 132 | 138 | } |
| 133 | 139 | |
| 134 | - if (!isset($connections[$name]['driver'])) { |
|
| 140 | + if (!isset($connections[$name]['driver'])) |
|
| 141 | + { |
|
| 135 | 142 | throw new InvalidArgumentException(\sprintf('Driver for queue connection `%s` is not defined.', $name)); |
| 136 | 143 | } |
| 137 | 144 | |
| 138 | 145 | $connection = $connections[$name]; |
| 139 | 146 | $driver = $connection['driver']; |
| 140 | 147 | |
| 141 | - if (!\is_string($driver)) { |
|
| 148 | + if (!\is_string($driver)) |
|
| 149 | + { |
|
| 142 | 150 | throw new InvalidArgumentException( |
| 143 | 151 | \sprintf('Driver for queue connection `%s` value must be a string', $name), |
| 144 | 152 | ); |
| 145 | 153 | } |
| 146 | 154 | |
| 147 | - if (isset($this->config['driverAliases'][$driver])) { |
|
| 155 | + if (isset($this->config['driverAliases'][$driver])) |
|
| 156 | + { |
|
| 148 | 157 | $connection['driver'] = $this->config['driverAliases'][$driver]; |
| 149 | 158 | } |
| 150 | 159 | |
| 151 | - if (!\is_string($connection['driver'])) { |
|
| 160 | + if (!\is_string($connection['driver'])) |
|
| 161 | + { |
|
| 152 | 162 | throw new InvalidArgumentException( |
| 153 | 163 | \sprintf('Driver alias for queue connection `%s` value must be a string', $name), |
| 154 | 164 | ); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | return self::First->value; |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | - '), \preg_replace('/\s+/', '', (string) $enum)); |
|
| 45 | + '), \preg_replace('/\s+/', '', (string)$enum)); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function testName(): void |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | final class MyClass extends Spiral\Tests\Reactor\ClassDeclarationTest implements Countable |
| 30 | 30 | { |
| 31 | - }'), \preg_replace('/\s+/', '', (string) $declaration)); |
|
| 31 | + }'), \preg_replace('/\s+/', '', (string)$declaration)); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function testClassDeclarationWithConstants(): void |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | #[Foo\Cached(mode: true)] |
| 77 | 77 | public const WITH_ATTRIBUTE = \'attr\'; |
| 78 | - }'), \preg_replace('/\s+/', '', (string) $declaration)); |
|
| 78 | + }'), \preg_replace('/\s+/', '', (string)$declaration)); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function testClassDeclarationWithMethods(): void |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | return count($items ?: $this->items); |
| 108 | 108 | } |
| 109 | - }'), \preg_replace('/\s+/', '', (string) $declaration)); |
|
| 109 | + }'), \preg_replace('/\s+/', '', (string)$declaration)); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | public function testName(): void |