| @@ -21,7 +21,8 @@ discard block | ||
| 21 | 21 | |
| 22 | 22 | $this->assertNull(ContainerScope::getContainer()); | 
| 23 | 23 | |
| 24 | -        $this->assertTrue(ContainerScope::runScope($container, function () use ($container) { | |
| 24 | + $this->assertTrue(ContainerScope::runScope($container, function () use ($container) | |
| 25 | +        { | |
| 25 | 26 | return $container === ContainerScope::getContainer(); | 
| 26 | 27 | })); | 
| 27 | 28 | |
| @@ -34,11 +35,14 @@ discard block | ||
| 34 | 35 | |
| 35 | 36 | $this->assertNull(ContainerScope::getContainer()); | 
| 36 | 37 | |
| 37 | -        try { | |
| 38 | + try | |
| 39 | +        { | |
| 38 | 40 |              $this->assertTrue(ContainerScope::runScope($container, function () use ($container): void { | 
| 39 | 41 |                  throw new RuntimeException('exception'); | 
| 40 | 42 | })); | 
| 41 | -        } catch (\Throwable $e) { | |
| 43 | + } | |
| 44 | + catch (\Throwable $e) | |
| 45 | +        { | |
| 42 | 46 | } | 
| 43 | 47 | |
| 44 | 48 | $this->assertInstanceOf(RuntimeException::class, $e); | 
| @@ -56,7 +60,8 @@ discard block | ||
| 56 | 60 | $this->assertTrue($c->runScope([ | 
| 57 | 61 |              'bucket' => new Bucket('b'), | 
| 58 | 62 | 'other' => new SampleClass() | 
| 59 | -        ], function ($c) { | |
| 63 | + ], function ($c) | |
| 64 | +        { | |
| 60 | 65 |              $this->assertSame('b', $c->get('bucket')->getName()); | 
| 61 | 66 |              $this->assertTrue($c->has('other')); | 
| 62 | 67 | |
| @@ -78,21 +83,25 @@ discard block | ||
| 78 | 83 | $this->assertTrue($c->runScope([ | 
| 79 | 84 |              'bucket' => new Bucket('b'), | 
| 80 | 85 | 'other' => new SampleClass() | 
| 81 | -        ], function ($c) { | |
| 86 | + ], function ($c) | |
| 87 | +        { | |
| 82 | 88 |              $this->assertSame('b', $c->get('bucket')->getName()); | 
| 83 | 89 |              $this->assertTrue($c->has('other')); | 
| 84 | 90 | |
| 85 | 91 |              return $c->get('bucket')->getName() == 'b' && $c->has('other'); | 
| 86 | 92 | })); | 
| 87 | 93 | |
| 88 | -        try { | |
| 94 | + try | |
| 95 | +        { | |
| 89 | 96 | $this->assertTrue($c->runScope([ | 
| 90 | 97 |                  'bucket' => new Bucket('b'), | 
| 91 | 98 | 'other' => new SampleClass() | 
| 92 | 99 |              ], function () use ($c): void { | 
| 93 | 100 |                  throw new RuntimeException('exception'); | 
| 94 | 101 | })); | 
| 95 | -        } catch (\Throwable $e) { | |
| 102 | + } | |
| 103 | + catch (\Throwable $e) | |
| 104 | +        { | |
| 96 | 105 | } | 
| 97 | 106 | |
| 98 | 107 |          $this->assertSame('a', $c->get('bucket')->getName()); | 
| @@ -108,7 +117,8 @@ discard block | ||
| 108 | 117 | ContainerScope::runScope($container, static fn (ContainerInterface $container) => $container) | 
| 109 | 118 | ); | 
| 110 | 119 | |
| 111 | -        $result = ContainerScope::runScope($container, static function (Container $container) { | |
| 120 | + $result = ContainerScope::runScope($container, static function (Container $container) | |
| 121 | +        { | |
| 112 | 122 | return $container->runScope([], static fn (Container $container) => $container); | 
| 113 | 123 | }); | 
| 114 | 124 | |
| @@ -136,10 +146,13 @@ discard block | ||
| 136 | 146 | public function testHasInstanceAfterMakeWithoutAliasInScope(): void | 
| 137 | 147 |      { | 
| 138 | 148 | $container = new Container(); | 
| 139 | -        $container->bindSingleton('test', new class implements SingletonInterface {}); | |
| 149 | +        $container->bindSingleton('test', new class implements SingletonInterface | |
| 150 | +        { | |
| 151 | +}); | |
| 140 | 152 |          $container->make('test'); | 
| 141 | 153 | |
| 142 | -        $container->runScoped(function (Container $container) { | |
| 154 | + $container->runScoped(function (Container $container) | |
| 155 | +        { | |
| 143 | 156 |              $this->assertTrue($container->hasInstance('test')); | 
| 144 | 157 | }); | 
| 145 | 158 | } | 
| @@ -150,7 +163,8 @@ discard block | ||
| 150 | 163 |          $container->bindSingleton('test', SampleClass::class); | 
| 151 | 164 |          $container->make('test'); | 
| 152 | 165 | |
| 153 | -        $container->runScoped(function (Container $container) { | |
| 166 | + $container->runScoped(function (Container $container) | |
| 167 | +        { | |
| 154 | 168 |              $this->assertTrue($container->hasInstance('test')); | 
| 155 | 169 | }); | 
| 156 | 170 | } | 
| @@ -165,7 +179,8 @@ discard block | ||
| 165 | 179 |          $container->bindSingleton('bar', 'foo'); | 
| 166 | 180 |          $container->make('bar'); | 
| 167 | 181 | |
| 168 | -        $container->runScoped(function (Container $container) { | |
| 182 | + $container->runScoped(function (Container $container) | |
| 183 | +        { | |
| 169 | 184 |              $this->assertTrue($container->hasInstance('test')); | 
| 170 | 185 | }); | 
| 171 | 186 | } |