@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | // from the current `foo` scope |
| 47 | 47 | self::assertInstanceOf(KVLogger::class, $logger); |
| 48 | 48 | |
| 49 | - for ($i = 0; $i < 10; $i++) { |
|
| 49 | + for ($i = 0; $i < 10; $i++){ |
|
| 50 | 50 | // because of proxy |
| 51 | 51 | self::assertNotInstanceOf(KVLogger::class, $carrier->getLogger()); |
| 52 | 52 | self::assertSame('kv', $carrier->logger->getName()); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | // from the current `foo` scope |
| 67 | 67 | self::assertInstanceOf(FileLogger::class, $logger); |
| 68 | 68 | |
| 69 | - for ($i = 0; $i < 10; $i++) { |
|
| 69 | + for ($i = 0; $i < 10; $i++){ |
|
| 70 | 70 | // because of proxy |
| 71 | 71 | self::assertNotInstanceOf(FileLogger::class, $carrier->getLogger()); |
| 72 | 72 | self::assertSame('file', $carrier->logger->getName()); |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | $root = new Container(); |
| 84 | 84 | $root->getBinder('http')->bindSingleton(LoggerInterface::class, KVLogger::class); |
| 85 | 85 | |
| 86 | - $root->runScope(new Scope(), static function (Container $c1) { |
|
| 86 | + $root->runScope(new Scope(), static function (Container $c1){ |
|
| 87 | 87 | $c1->runScope( |
| 88 | 88 | new Scope(name: 'http'), |
| 89 | 89 | static function ( |
| 90 | 90 | ScopedProxyLoggerCarrier $carrier, |
| 91 | 91 | ScopedProxyLoggerCarrier $carrier2, |
| 92 | 92 | LoggerInterface $logger, |
| 93 | - ) { |
|
| 93 | + ){ |
|
| 94 | 94 | // from the current `foo` scope |
| 95 | 95 | self::assertInstanceOf(KVLogger::class, $logger); |
| 96 | 96 | |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | $root = new Container(); |
| 111 | 111 | $root->getBinder('foo')->bind(LoggerInterface::class, KVLogger::class); |
| 112 | 112 | |
| 113 | - $root->runScope(new Scope(), static function (Container $c1) { |
|
| 113 | + $root->runScope(new Scope(), static function (Container $c1){ |
|
| 114 | 114 | $c1->runScope( |
| 115 | 115 | new Scope(name: 'foo'), |
| 116 | - static function (ScopedProxyLoggerCarrier $carrier, LoggerInterface $logger) { |
|
| 116 | + static function (ScopedProxyLoggerCarrier $carrier, LoggerInterface $logger){ |
|
| 117 | 117 | // from the current `foo` scope |
| 118 | 118 | self::assertInstanceOf(KVLogger::class, $logger); |
| 119 | 119 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | ->bind( |
| 135 | 135 | ContextInterface::class, |
| 136 | 136 | new \Spiral\Core\Config\Injectable( |
| 137 | - new class implements InjectorInterface { |
|
| 137 | + new class implements InjectorInterface{ |
|
| 138 | 138 | public function createInjection(\ReflectionClass $class, mixed $context = null): Context |
| 139 | 139 | { |
| 140 | 140 | return new Context($context); |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | ), |
| 144 | 144 | ); |
| 145 | 145 | |
| 146 | - $root->runScope(new Scope(), static function (Container $c1) { |
|
| 147 | - $c1->runScope(new Scope(name: 'foo'), static function (Container $c, ContextInterface $param) { |
|
| 146 | + $root->runScope(new Scope(), static function (Container $c1){ |
|
| 147 | + $c1->runScope(new Scope(name: 'foo'), static function (Container $c, ContextInterface $param){ |
|
| 148 | 148 | self::assertInstanceOf(ReflectionParameter::class, $param->value); |
| 149 | 149 | self::assertSame('param', $param->value->getName()); |
| 150 | 150 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | ->bind( |
| 176 | 176 | ContextInterface::class, |
| 177 | 177 | new \Spiral\Core\Config\Injectable( |
| 178 | - new class implements InjectorInterface { |
|
| 178 | + new class implements InjectorInterface{ |
|
| 179 | 179 | public function createInjection(\ReflectionClass $class, mixed $context = null): Context |
| 180 | 180 | { |
| 181 | 181 | return new Context($context); |
@@ -185,15 +185,15 @@ discard block |
||
| 185 | 185 | ); |
| 186 | 186 | |
| 187 | 187 | FiberHelper::runFiberSequence( |
| 188 | - static fn() => $root->runScope(new Scope(name: 'foo'), static function (ContextInterface $ctx) { |
|
| 189 | - for ($i = 0; $i < 10; $i++) { |
|
| 188 | + static fn() => $root->runScope(new Scope(name: 'foo'), static function (ContextInterface $ctx){ |
|
| 189 | + for ($i = 0; $i < 10; $i++){ |
|
| 190 | 190 | self::assertInstanceOf(ReflectionParameter::class, $ctx->getValue(), 'Context injected'); |
| 191 | 191 | self::assertSame('ctx', $ctx->getValue()->getName()); |
| 192 | 192 | \Fiber::suspend(); |
| 193 | 193 | } |
| 194 | 194 | }), |
| 195 | - static fn() => $root->runScope(new Scope(name: 'foo'), static function (ContextInterface $context) { |
|
| 196 | - for ($i = 0; $i < 10; $i++) { |
|
| 195 | + static fn() => $root->runScope(new Scope(name: 'foo'), static function (ContextInterface $context){ |
|
| 196 | + for ($i = 0; $i < 10; $i++){ |
|
| 197 | 197 | self::assertInstanceOf(ReflectionParameter::class, $context->getValue(), 'Context injected'); |
| 198 | 198 | self::assertSame('context', $context->getValue()->getName()); |
| 199 | 199 | \Fiber::suspend(); |
@@ -254,10 +254,10 @@ discard block |
||
| 254 | 254 | { |
| 255 | 255 | $root = new Container(); |
| 256 | 256 | $context = (object)['destroyed' => false]; |
| 257 | - $class = new class($context) implements DestroyableInterface { |
|
| 257 | + $class = new class($context) implements DestroyableInterface{ |
|
| 258 | 258 | public function __construct( |
| 259 | 259 | private readonly \stdClass $context, |
| 260 | - ) { |
|
| 260 | + ){ |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | public function __destruct() |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | new Scope('http'), |
| 286 | 286 | static function () use ($root, $proxy) { |
| 287 | 287 | self::assertSame('Foo', $proxy->getName()); |
| 288 | - $proxy->setName(new class implements \Stringable { |
|
| 288 | + $proxy->setName(new class implements \Stringable{ |
|
| 289 | 289 | public function __toString(): string |
| 290 | 290 | { |
| 291 | 291 | return 'Bar'; |