@@ -13,18 +13,18 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | public const INJECTOR = ClassLocatorInjector::class; |
| 15 | 15 | |
| 16 | - public function getClasses(object|string|null $target = null): array |
|
| 16 | + public function getClasses(object | string | null $target = null): array |
|
| 17 | 17 | { |
| 18 | - if (!empty($target)) { |
|
| 18 | + if (!empty($target)){ |
|
| 19 | 19 | $target = new \ReflectionClass($target); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | $result = []; |
| 23 | - foreach ($this->availableClasses() as $class) { |
|
| 24 | - try { |
|
| 23 | + foreach ($this->availableClasses() as $class){ |
|
| 24 | + try{ |
|
| 25 | 25 | $reflection = $this->classReflection($class); |
| 26 | - } catch (LocatorException $e) { |
|
| 27 | - if ($this->debug) { |
|
| 26 | + }catch (LocatorException $e){ |
|
| 27 | + if ($this->debug){ |
|
| 28 | 28 | throw $e; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | continue; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if (!$this->isTargeted($reflection, $target) || $reflection->isInterface()) { |
|
| 35 | + if (!$this->isTargeted($reflection, $target) || $reflection->isInterface()){ |
|
| 36 | 36 | continue; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | $classes = []; |
| 53 | 53 | |
| 54 | - foreach ($this->availableReflections() as $reflection) { |
|
| 54 | + foreach ($this->availableReflections() as $reflection){ |
|
| 55 | 55 | $classes = \array_merge($classes, $reflection->getClasses()); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function isTargeted(\ReflectionClass $class, ?\ReflectionClass $target = null): bool |
| 65 | 65 | { |
| 66 | - if (empty($target)) { |
|
| 66 | + if (empty($target)){ |
|
| 67 | 67 | return true; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if (!$target->isTrait()) { |
|
| 70 | + if (!$target->isTrait()){ |
|
| 71 | 71 | //Target is interface or class |
| 72 | 72 | return $class->isSubclassOf($target) || $class->getName() === $target->getName(); |
| 73 | 73 | } |
@@ -15,16 +15,22 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | public function getClasses(object|string|null $target = null): array |
| 17 | 17 | { |
| 18 | - if (!empty($target)) { |
|
| 18 | + if (!empty($target)) |
|
| 19 | + { |
|
| 19 | 20 | $target = new \ReflectionClass($target); |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | $result = []; |
| 23 | - foreach ($this->availableClasses() as $class) { |
|
| 24 | - try { |
|
| 24 | + foreach ($this->availableClasses() as $class) |
|
| 25 | + { |
|
| 26 | + try |
|
| 27 | + { |
|
| 25 | 28 | $reflection = $this->classReflection($class); |
| 26 | - } catch (LocatorException $e) { |
|
| 27 | - if ($this->debug) { |
|
| 29 | + } |
|
| 30 | + catch (LocatorException $e) |
|
| 31 | + { |
|
| 32 | + if ($this->debug) |
|
| 33 | + { |
|
| 28 | 34 | throw $e; |
| 29 | 35 | } |
| 30 | 36 | |
@@ -32,7 +38,8 @@ discard block |
||
| 32 | 38 | continue; |
| 33 | 39 | } |
| 34 | 40 | |
| 35 | - if (!$this->isTargeted($reflection, $target) || $reflection->isInterface()) { |
|
| 41 | + if (!$this->isTargeted($reflection, $target) || $reflection->isInterface()) |
|
| 42 | + { |
|
| 36 | 43 | continue; |
| 37 | 44 | } |
| 38 | 45 | |
@@ -51,7 +58,8 @@ discard block |
||
| 51 | 58 | { |
| 52 | 59 | $classes = []; |
| 53 | 60 | |
| 54 | - foreach ($this->availableReflections() as $reflection) { |
|
| 61 | + foreach ($this->availableReflections() as $reflection) |
|
| 62 | + { |
|
| 55 | 63 | $classes = \array_merge($classes, $reflection->getClasses()); |
| 56 | 64 | } |
| 57 | 65 | |
@@ -63,11 +71,13 @@ discard block |
||
| 63 | 71 | */ |
| 64 | 72 | protected function isTargeted(\ReflectionClass $class, ?\ReflectionClass $target = null): bool |
| 65 | 73 | { |
| 66 | - if (empty($target)) { |
|
| 74 | + if (empty($target)) |
|
| 75 | + { |
|
| 67 | 76 | return true; |
| 68 | 77 | } |
| 69 | 78 | |
| 70 | - if (!$target->isTrait()) { |
|
| 79 | + if (!$target->isTrait()) |
|
| 80 | + { |
|
| 71 | 81 | //Target is interface or class |
| 72 | 82 | return $class->isSubclassOf($target) || $class->getName() === $target->getName(); |
| 73 | 83 | } |
@@ -9,8 +9,8 @@ |
||
| 9 | 9 | public function __construct(?\Throwable $previous = null, ?string $message = null) |
| 10 | 10 | { |
| 11 | 11 | parent::__construct( |
| 12 | - message: $message ?? 'Unable to set value. The given data was invalid.', |
|
| 13 | - previous: $previous, |
|
| 12 | + message : $message ?? 'Unable to set value. The given data was invalid.', |
|
| 13 | + previous : $previous, |
|
| 14 | 14 | ); |
| 15 | 15 | } |
| 16 | 16 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | protected function compile(string $source, array $visitors = [], ?LoaderInterface $loader = null) |
| 29 | 29 | { |
| 30 | - if ($loader === null) { |
|
| 30 | + if ($loader === null){ |
|
| 31 | 31 | $loader = new StringLoader(); |
| 32 | 32 | $loader->set('root', $source); |
| 33 | 33 | } |
@@ -62,11 +62,11 @@ discard block |
||
| 62 | 62 | $builder->getCompiler()->addRenderer(new DynamicRenderer(new DirectiveGroup())); |
| 63 | 63 | $builder->getCompiler()->addRenderer(new HTMLRenderer()); |
| 64 | 64 | |
| 65 | - foreach ($this->getVisitors() as $visitor) { |
|
| 65 | + foreach ($this->getVisitors() as $visitor){ |
|
| 66 | 66 | $builder->addVisitor($visitor); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - foreach ($visitors as $visitor) { |
|
| 69 | + foreach ($visitors as $visitor){ |
|
| 70 | 70 | $builder->addVisitor($visitor); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -80,6 +80,6 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | protected function getFixtureLoader(): LoaderInterface |
| 82 | 82 | { |
| 83 | - return new DirectoryLoader(__DIR__ . '/../fixtures'); |
|
| 83 | + return new DirectoryLoader(__DIR__.'/../fixtures'); |
|
| 84 | 84 | } |
| 85 | 85 | } |
@@ -27,7 +27,8 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | protected function compile(string $source, array $visitors = [], ?LoaderInterface $loader = null) |
| 29 | 29 | { |
| 30 | - if ($loader === null) { |
|
| 30 | + if ($loader === null) |
|
| 31 | + { |
|
| 31 | 32 | $loader = new StringLoader(); |
| 32 | 33 | $loader->set('root', $source); |
| 33 | 34 | } |
@@ -62,11 +63,13 @@ discard block |
||
| 62 | 63 | $builder->getCompiler()->addRenderer(new DynamicRenderer(new DirectiveGroup())); |
| 63 | 64 | $builder->getCompiler()->addRenderer(new HTMLRenderer()); |
| 64 | 65 | |
| 65 | - foreach ($this->getVisitors() as $visitor) { |
|
| 66 | + foreach ($this->getVisitors() as $visitor) |
|
| 67 | + { |
|
| 66 | 68 | $builder->addVisitor($visitor); |
| 67 | 69 | } |
| 68 | 70 | |
| 69 | - foreach ($visitors as $visitor) { |
|
| 71 | + foreach ($visitors as $visitor) |
|
| 72 | + { |
|
| 70 | 73 | $builder->addVisitor($visitor); |
| 71 | 74 | } |
| 72 | 75 | |
@@ -24,22 +24,22 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function withinContext(?Context $ctx, callable $body): void |
| 26 | 26 | { |
| 27 | - if ($ctx === null || $ctx->getPath() === null) { |
|
| 27 | + if ($ctx === null || $ctx->getPath() === null){ |
|
| 28 | 28 | $body($this); |
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - try { |
|
| 32 | + try{ |
|
| 33 | 33 | $this->parent = Location::fromContext($ctx, $this->parent); |
| 34 | 34 | $body($this); |
| 35 | - } finally { |
|
| 35 | + }finally{ |
|
| 36 | 36 | $this->parent = $this->parent->parent; |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function push(string $content, ?Context $ctx = null): void |
| 41 | 41 | { |
| 42 | - if ($ctx !== null && $ctx->getPath() !== null) { |
|
| 42 | + if ($ctx !== null && $ctx->getPath() !== null){ |
|
| 43 | 43 | $this->locations[\strlen($this->content)] = Location::fromContext($ctx, $this->parent); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | $paths = []; |
| 60 | 60 | |
| 61 | 61 | // We can scan top level only |
| 62 | - foreach ($this->locations as $loc) { |
|
| 63 | - if (!\in_array($loc->path, $paths, true)) { |
|
| 62 | + foreach ($this->locations as $loc){ |
|
| 63 | + if (!\in_array($loc->path, $paths, true)){ |
|
| 64 | 64 | $paths[] = $loc->path; |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | $locations = []; |
| 77 | 77 | |
| 78 | - foreach ($this->locations as $offset => $location) { |
|
| 78 | + foreach ($this->locations as $offset => $location){ |
|
| 79 | 79 | $locations[$offset] = $location; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -24,22 +24,27 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function withinContext(?Context $ctx, callable $body): void |
| 26 | 26 | { |
| 27 | - if ($ctx === null || $ctx->getPath() === null) { |
|
| 27 | + if ($ctx === null || $ctx->getPath() === null) |
|
| 28 | + { |
|
| 28 | 29 | $body($this); |
| 29 | 30 | return; |
| 30 | 31 | } |
| 31 | 32 | |
| 32 | - try { |
|
| 33 | + try |
|
| 34 | + { |
|
| 33 | 35 | $this->parent = Location::fromContext($ctx, $this->parent); |
| 34 | 36 | $body($this); |
| 35 | - } finally { |
|
| 37 | + } |
|
| 38 | + finally |
|
| 39 | + { |
|
| 36 | 40 | $this->parent = $this->parent->parent; |
| 37 | 41 | } |
| 38 | 42 | } |
| 39 | 43 | |
| 40 | 44 | public function push(string $content, ?Context $ctx = null): void |
| 41 | 45 | { |
| 42 | - if ($ctx !== null && $ctx->getPath() !== null) { |
|
| 46 | + if ($ctx !== null && $ctx->getPath() !== null) |
|
| 47 | + { |
|
| 43 | 48 | $this->locations[\strlen($this->content)] = Location::fromContext($ctx, $this->parent); |
| 44 | 49 | } |
| 45 | 50 | |
@@ -59,8 +64,10 @@ discard block |
||
| 59 | 64 | $paths = []; |
| 60 | 65 | |
| 61 | 66 | // We can scan top level only |
| 62 | - foreach ($this->locations as $loc) { |
|
| 63 | - if (!\in_array($loc->path, $paths, true)) { |
|
| 67 | + foreach ($this->locations as $loc) |
|
| 68 | + { |
|
| 69 | + if (!\in_array($loc->path, $paths, true)) |
|
| 70 | + { |
|
| 64 | 71 | $paths[] = $loc->path; |
| 65 | 72 | } |
| 66 | 73 | } |
@@ -75,7 +82,8 @@ discard block |
||
| 75 | 82 | { |
| 76 | 83 | $locations = []; |
| 77 | 84 | |
| 78 | - foreach ($this->locations as $offset => $location) { |
|
| 85 | + foreach ($this->locations as $offset => $location) |
|
| 86 | + { |
|
| 79 | 87 | $locations[$offset] = $location; |
| 80 | 88 | } |
| 81 | 89 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | ?int $int = 123, |
| 21 | 21 | ?\StdClass $nullableClass2 = null, |
| 22 | 22 | string ...$variadicVar |
| 23 | - ) { |
|
| 23 | + ){ |
|
| 24 | 24 | $var2 = new ATest3(); |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * @param non-empty-string|int $code |
| 29 | 29 | * @param non-empty-string|null $description |
| 30 | 30 | */ |
| 31 | - public function setStatus(string|int $code, ?string $description = null): self; |
|
| 31 | + public function setStatus(string | int $code, ?string $description = null): self; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Get the current span status. |
@@ -18,21 +18,21 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | abstract public function bucket(?string $name = null): BucketInterface; |
| 20 | 20 | |
| 21 | - public function getContents(string|\Stringable $id): string |
|
| 21 | + public function getContents(string | \Stringable $id): string |
|
| 22 | 22 | { |
| 23 | 23 | [$name, $pathname] = $this->parseUri($id); |
| 24 | 24 | |
| 25 | 25 | return $this->bucket($name)->getContents($pathname); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public function getStream(string|\Stringable $id) |
|
| 28 | + public function getStream(string | \Stringable $id) |
|
| 29 | 29 | { |
| 30 | 30 | [$name, $pathname] = $this->parseUri($id); |
| 31 | 31 | |
| 32 | 32 | return $this->bucket($name)->getStream($pathname); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function exists(string|\Stringable $id): bool |
|
| 35 | + public function exists(string | \Stringable $id): bool |
|
| 36 | 36 | { |
| 37 | 37 | [$name, $pathname] = $this->parseUri($id); |
| 38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * @return int<0, max> |
| 44 | 44 | */ |
| 45 | - public function getLastModified(string|\Stringable $id): int |
|
| 45 | + public function getLastModified(string | \Stringable $id): int |
|
| 46 | 46 | { |
| 47 | 47 | [$name, $pathname] = $this->parseUri($id); |
| 48 | 48 | |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * @return int<0, max> |
| 54 | 54 | */ |
| 55 | - public function getSize(string|\Stringable $id): int |
|
| 55 | + public function getSize(string | \Stringable $id): int |
|
| 56 | 56 | { |
| 57 | 57 | [$name, $pathname] = $this->parseUri($id); |
| 58 | 58 | |
| 59 | 59 | return $this->bucket($name)->getSize($pathname); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function getMimeType(string|\Stringable $id): string |
|
| 62 | + public function getMimeType(string | \Stringable $id): string |
|
| 63 | 63 | { |
| 64 | 64 | [$name, $pathname] = $this->parseUri($id); |
| 65 | 65 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @return Visibility::VISIBILITY_* |
| 71 | 71 | */ |
| 72 | 72 | #[ExpectedValues(valuesFromClass: Visibility::class)] |
| 73 | - public function getVisibility(string|\Stringable $id): string |
|
| 73 | + public function getVisibility(string | \Stringable $id): string |
|
| 74 | 74 | { |
| 75 | 75 | [$name, $pathname] = $this->parseUri($id); |
| 76 | 76 | |
@@ -80,5 +80,5 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * {@see Storage::parseUri()} |
| 82 | 82 | */ |
| 83 | - abstract protected function parseUri(string|\Stringable $uri, bool $withScheme = true): array; |
|
| 83 | + abstract protected function parseUri(string | \Stringable $uri, bool $withScheme = true): array; |
|
| 84 | 84 | } |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $root = self::makeContainer(); |
| 23 | 23 | |
| 24 | - $obj = $root->runScoped(static function (Container $c1) { |
|
| 25 | - $obj = $c1->runScoped(static function (Container $c2) { |
|
| 24 | + $obj = $root->runScoped(static function (Container $c1){ |
|
| 25 | + $obj = $c1->runScoped(static function (Container $c2){ |
|
| 26 | 26 | $obj = $c2->get(AttrScopeFooFinalize::class); |
| 27 | 27 | |
| 28 | 28 | self::assertFalse($obj->finalized); |
@@ -124,12 +124,12 @@ discard block |
||
| 124 | 124 | self::expectException(FinalizersException::class); |
| 125 | 125 | self::expectExceptionMessage('An exception has been thrown during finalization of the scope `foo`'); |
| 126 | 126 | |
| 127 | - try { |
|
| 127 | + try{ |
|
| 128 | 128 | $root->runScoped(static function (Container $c1): void { |
| 129 | 129 | $obj = $c1->get(AttrScopeFooFinalize::class); |
| 130 | 130 | $obj->throwException = true; |
| 131 | 131 | }, name: 'foo'); |
| 132 | - } catch (FinalizersException $e) { |
|
| 132 | + }catch (FinalizersException $e){ |
|
| 133 | 133 | self::assertSame('foo', $e->getScope()); |
| 134 | 134 | self::assertCount(1, $e->getExceptions()); |
| 135 | 135 | // Contains the message from the inner exception. |
@@ -153,13 +153,13 @@ discard block |
||
| 153 | 153 | self::expectException(FinalizersException::class); |
| 154 | 154 | self::expectExceptionMessage('3 exceptions have been thrown during finalization of the scope `foo`'); |
| 155 | 155 | |
| 156 | - try { |
|
| 156 | + try{ |
|
| 157 | 157 | $root->runScoped(static function (Container $c1): void { |
| 158 | 158 | $c1->get(AttrScopeFooFinalize::class)->throwException = true; |
| 159 | 159 | $c1->get(AttrScopeFooFinalize::class)->throwException = true; |
| 160 | 160 | $c1->get(AttrScopeFooFinalize::class)->throwException = true; |
| 161 | 161 | }, name: 'foo'); |
| 162 | - } catch (FinalizersException $e) { |
|
| 162 | + }catch (FinalizersException $e){ |
|
| 163 | 163 | self::assertSame('foo', $e->getScope()); |
| 164 | 164 | self::assertCount(3, $e->getExceptions()); |
| 165 | 165 | // Contains the message from the inner exception. |
@@ -21,8 +21,10 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $root = self::makeContainer(); |
| 23 | 23 | |
| 24 | - $obj = $root->runScoped(static function (Container $c1) { |
|
| 25 | - $obj = $c1->runScoped(static function (Container $c2) { |
|
| 24 | + $obj = $root->runScoped(static function (Container $c1) |
|
| 25 | + { |
|
| 26 | + $obj = $c1->runScoped(static function (Container $c2) |
|
| 27 | + { |
|
| 26 | 28 | $obj = $c2->get(AttrScopeFooFinalize::class); |
| 27 | 29 | |
| 28 | 30 | self::assertFalse($obj->finalized); |
@@ -46,8 +48,10 @@ discard block |
||
| 46 | 48 | $root->bindSingleton(LoggerInterface::class, FileLogger::class); |
| 47 | 49 | |
| 48 | 50 | $obj2 = null; |
| 49 | - $obj = $root->runScoped(static function (Container $c1) use (&$obj2) { |
|
| 50 | - $obj = $c1->runScoped(static function (Container $c2) use (&$obj2) { |
|
| 51 | + $obj = $root->runScoped(static function (Container $c1) use (&$obj2) |
|
| 52 | + { |
|
| 53 | + $obj = $c1->runScoped(static function (Container $c2) use (&$obj2) |
|
| 54 | + { |
|
| 51 | 55 | $obj = $c2->get(AttrScopeFooFinalize::class); |
| 52 | 56 | $obj2 = $c2->get(AttrScopeFooFinalize::class); |
| 53 | 57 | |
@@ -77,8 +81,10 @@ discard block |
||
| 77 | 81 | $root->bindSingleton(LoggerInterface::class, FileLogger::class); |
| 78 | 82 | |
| 79 | 83 | $obj2 = null; |
| 80 | - $obj = $root->runScoped(static function (Container $c1) use (&$obj2) { |
|
| 81 | - $obj = $c1->runScoped(static function (Container $c2) use (&$obj2) { |
|
| 84 | + $obj = $root->runScoped(static function (Container $c1) use (&$obj2) |
|
| 85 | + { |
|
| 86 | + $obj = $c1->runScoped(static function (Container $c2) use (&$obj2) |
|
| 87 | + { |
|
| 82 | 88 | $obj = $c2->get(AttrFinalize::class); |
| 83 | 89 | $obj2 = $c2->get(AttrFinalize::class); |
| 84 | 90 | |
@@ -124,12 +130,15 @@ discard block |
||
| 124 | 130 | self::expectException(FinalizersException::class); |
| 125 | 131 | self::expectExceptionMessage('An exception has been thrown during finalization of the scope `foo`'); |
| 126 | 132 | |
| 127 | - try { |
|
| 133 | + try |
|
| 134 | + { |
|
| 128 | 135 | $root->runScoped(static function (Container $c1): void { |
| 129 | 136 | $obj = $c1->get(AttrScopeFooFinalize::class); |
| 130 | 137 | $obj->throwException = true; |
| 131 | 138 | }, name: 'foo'); |
| 132 | - } catch (FinalizersException $e) { |
|
| 139 | + } |
|
| 140 | + catch (FinalizersException $e) |
|
| 141 | + { |
|
| 133 | 142 | self::assertSame('foo', $e->getScope()); |
| 134 | 143 | self::assertCount(1, $e->getExceptions()); |
| 135 | 144 | // Contains the message from the inner exception. |
@@ -153,13 +162,16 @@ discard block |
||
| 153 | 162 | self::expectException(FinalizersException::class); |
| 154 | 163 | self::expectExceptionMessage('3 exceptions have been thrown during finalization of the scope `foo`'); |
| 155 | 164 | |
| 156 | - try { |
|
| 165 | + try |
|
| 166 | + { |
|
| 157 | 167 | $root->runScoped(static function (Container $c1): void { |
| 158 | 168 | $c1->get(AttrScopeFooFinalize::class)->throwException = true; |
| 159 | 169 | $c1->get(AttrScopeFooFinalize::class)->throwException = true; |
| 160 | 170 | $c1->get(AttrScopeFooFinalize::class)->throwException = true; |
| 161 | 171 | }, name: 'foo'); |
| 162 | - } catch (FinalizersException $e) { |
|
| 172 | + } |
|
| 173 | + catch (FinalizersException $e) |
|
| 174 | + { |
|
| 163 | 175 | self::assertSame('foo', $e->getScope()); |
| 164 | 176 | self::assertCount(3, $e->getExceptions()); |
| 165 | 177 | // Contains the message from the inner exception. |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $root = self::makeContainer(); |
| 167 | 167 | |
| 168 | - try { |
|
| 168 | + try{ |
|
| 169 | 169 | $root->runScoped(static function (Container $c1): void { |
| 170 | 170 | $c1->runScoped(static function (Container $c2): void { |
| 171 | 171 | $c2->runScoped(static function (Container $c3): void { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | }, name: 'root'); |
| 174 | 174 | }); |
| 175 | 175 | }); |
| 176 | - } catch (NamedScopeDuplicationException $e) { |
|
| 176 | + }catch (NamedScopeDuplicationException $e){ |
|
| 177 | 177 | self::assertSame('root', $e->getScope()); |
| 178 | 178 | throw $e; |
| 179 | 179 | } |
@@ -188,14 +188,14 @@ discard block |
||
| 188 | 188 | { |
| 189 | 189 | self::expectException(BadScopeException::class); |
| 190 | 190 | |
| 191 | - try { |
|
| 191 | + try{ |
|
| 192 | 192 | $root = self::makeContainer(); |
| 193 | 193 | $root->runScoped(static function (Container $c1): void { |
| 194 | 194 | $c1->runScoped(static function (Container $c2): void { |
| 195 | 195 | $c2->get(AttrScopeFoo::class); |
| 196 | 196 | }); |
| 197 | 197 | }, name: 'bar'); |
| 198 | - } catch (BadScopeException $e) { |
|
| 198 | + }catch (BadScopeException $e){ |
|
| 199 | 199 | self::assertSame('foo', $e->getScope()); |
| 200 | 200 | throw $e; |
| 201 | 201 | } |
@@ -165,7 +165,8 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $root = self::makeContainer(); |
| 167 | 167 | |
| 168 | - try { |
|
| 168 | + try |
|
| 169 | + { |
|
| 169 | 170 | $root->runScoped(static function (Container $c1): void { |
| 170 | 171 | $c1->runScoped(static function (Container $c2): void { |
| 171 | 172 | $c2->runScoped(static function (Container $c3): void { |
@@ -173,7 +174,9 @@ discard block |
||
| 173 | 174 | }, name: 'root'); |
| 174 | 175 | }); |
| 175 | 176 | }); |
| 176 | - } catch (NamedScopeDuplicationException $e) { |
|
| 177 | + } |
|
| 178 | + catch (NamedScopeDuplicationException $e) |
|
| 179 | + { |
|
| 177 | 180 | self::assertSame('root', $e->getScope()); |
| 178 | 181 | throw $e; |
| 179 | 182 | } |
@@ -188,14 +191,17 @@ discard block |
||
| 188 | 191 | { |
| 189 | 192 | self::expectException(BadScopeException::class); |
| 190 | 193 | |
| 191 | - try { |
|
| 194 | + try |
|
| 195 | + { |
|
| 192 | 196 | $root = self::makeContainer(); |
| 193 | 197 | $root->runScoped(static function (Container $c1): void { |
| 194 | 198 | $c1->runScoped(static function (Container $c2): void { |
| 195 | 199 | $c2->get(AttrScopeFoo::class); |
| 196 | 200 | }); |
| 197 | 201 | }, name: 'bar'); |
| 198 | - } catch (BadScopeException $e) { |
|
| 202 | + } |
|
| 203 | + catch (BadScopeException $e) |
|
| 204 | + { |
|
| 199 | 205 | self::assertSame('foo', $e->getScope()); |
| 200 | 206 | throw $e; |
| 201 | 207 | } |