Test Failed
Pull Request — master (#870)
by Aleksei
07:48
created
src/Core/tests/Scope/Stub/AttrScopeFooFinalize.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     {
21 21
         $this->logger = $logger;
22 22
         $this->finalized = true;
23
-        if ($this->throwException) {
23
+        if ($this->throwException){
24 24
             throw new RuntimeException('Test exception from finalize method.');
25 25
         }
26 26
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@
 block discarded – undo
20 20
     {
21 21
         $this->logger = $logger;
22 22
         $this->finalized = true;
23
-        if ($this->throwException) {
23
+        if ($this->throwException)
24
+        {
24 25
             throw new RuntimeException('Test exception from finalize method.');
25 26
         }
26 27
     }
Please login to merge, or discard this patch.
src/Core/tests/Scope/Stub/Factory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 {
11 11
     public function __construct(
12 12
         protected ContainerInterface $container,
13
-    ) {
13
+    ){
14 14
     }
15 15
 
16 16
     public function make(string $key): mixed
Please login to merge, or discard this patch.
src/Core/tests/Scope/Stub/LoggerCarrier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
 {
9 9
     public function __construct(
10 10
         public LoggerInterface $logger,
11
-    ) {
11
+    ){
12 12
     }
13 13
 }
Please login to merge, or discard this patch.
src/Core/tests/Scope/ExceptionsTest.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 
19 19
         $container = new Container();
20 20
 
21
-        $container->scope(static function (Container $c1) {
22
-            try {
21
+        $container->scope(static function (Container $c1){
22
+            try{
23 23
                 $c1->get(ExceptionConstructor::class);
24 24
                 self::fail('Exception should be thrown');
25
-            } catch (\Throwable $e) {
25
+            }catch (\Throwable $e){
26 26
                 // self::assertInstanceOf(\InvalidArgumentException::class, $e);
27 27
                 throw $e;
28 28
             }
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 
37 37
         $container = new Container();
38 38
 
39
-        $container->scope(static function (Container $c1) {
40
-            try {
39
+        $container->scope(static function (Container $c1){
40
+            try{
41 41
                 $c1->get(ExceptionConstructor::class);
42 42
                 self::fail('Exception should be thrown');
43
-            } catch (\Throwable $e) {
43
+            }catch (\Throwable $e){
44 44
                 // self::assertInstanceOf(\InvalidArgumentException::class, $e);
45 45
                 throw $e;
46 46
             }
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 
55 55
         $container = new Container();
56 56
 
57
-        $container->scope(static function (Container $c1) {
58
-            try {
57
+        $container->scope(static function (Container $c1){
58
+            try{
59 59
                 $c1->get(DatetimeCarrier::class);
60 60
                 self::fail('Exception should be thrown');
61
-            } catch (\Throwable $e) {
61
+            }catch (\Throwable $e){
62 62
                 self::assertInstanceOf(NotFoundException::class, $e);
63 63
                 self::assertInstanceOf(NotFoundException::class, $e->getPrevious());
64 64
                 self::assertStringContainsString(
Please login to merge, or discard this patch.
Braces   +21 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,11 +18,15 @@  discard block
 block discarded – undo
18 18
 
19 19
         $container = new Container();
20 20
 
21
-        $container->scope(static function (Container $c1) {
22
-            try {
21
+        $container->scope(static function (Container $c1)
22
+        {
23
+            try
24
+            {
23 25
                 $c1->get(ExceptionConstructor::class);
24 26
                 self::fail('Exception should be thrown');
25
-            } catch (\Throwable $e) {
27
+            }
28
+            catch (\Throwable $e)
29
+            {
26 30
                 // self::assertInstanceOf(\InvalidArgumentException::class, $e);
27 31
                 throw $e;
28 32
             }
@@ -36,11 +40,15 @@  discard block
 block discarded – undo
36 40
 
37 41
         $container = new Container();
38 42
 
39
-        $container->scope(static function (Container $c1) {
40
-            try {
43
+        $container->scope(static function (Container $c1)
44
+        {
45
+            try
46
+            {
41 47
                 $c1->get(ExceptionConstructor::class);
42 48
                 self::fail('Exception should be thrown');
43
-            } catch (\Throwable $e) {
49
+            }
50
+            catch (\Throwable $e)
51
+            {
44 52
                 // self::assertInstanceOf(\InvalidArgumentException::class, $e);
45 53
                 throw $e;
46 54
             }
@@ -54,11 +62,15 @@  discard block
 block discarded – undo
54 62
 
55 63
         $container = new Container();
56 64
 
57
-        $container->scope(static function (Container $c1) {
58
-            try {
65
+        $container->scope(static function (Container $c1)
66
+        {
67
+            try
68
+            {
59 69
                 $c1->get(DatetimeCarrier::class);
60 70
                 self::fail('Exception should be thrown');
61
-            } catch (\Throwable $e) {
71
+            }
72
+            catch (\Throwable $e)
73
+            {
62 74
                 self::assertInstanceOf(NotFoundException::class, $e);
63 75
                 self::assertInstanceOf(NotFoundException::class, $e->getPrevious());
64 76
                 self::assertStringContainsString(
Please login to merge, or discard this patch.
src/Core/tests/Scope/SideEffectTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
         $root = new Container();
23 23
         $root->bind(LoggerInterface::class, KVLogger::class);
24 24
 
25
-        $root->scope(static function (Container $c1) {
25
+        $root->scope(static function (Container $c1){
26 26
             $c1->bind(LoggerInterface::class, FileLogger::class);
27 27
 
28
-            $c1->scope(static function (LoggerCarrier $carrier, LoggerInterface $logger) {
28
+            $c1->scope(static function (LoggerCarrier $carrier, LoggerInterface $logger){
29 29
                 // from the $root container
30 30
                 self::assertInstanceOf(KVLogger::class, $carrier->logger);
31 31
                 // from the $c1 container
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $root = new Container();
40 40
         $root->bind(LoggerInterface::class, KVLogger::class);
41 41
 
42
-        $root->scope(static function (Container $c1) {
42
+        $root->scope(static function (Container $c1){
43 43
             $c1->bind(LoggerInterface::class, FileLogger::class);
44 44
 
45 45
             self::assertInstanceOf(
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,10 +22,12 @@  discard block
 block discarded – undo
22 22
         $root = new Container();
23 23
         $root->bind(LoggerInterface::class, KVLogger::class);
24 24
 
25
-        $root->scope(static function (Container $c1) {
25
+        $root->scope(static function (Container $c1)
26
+        {
26 27
             $c1->bind(LoggerInterface::class, FileLogger::class);
27 28
 
28
-            $c1->scope(static function (LoggerCarrier $carrier, LoggerInterface $logger) {
29
+            $c1->scope(static function (LoggerCarrier $carrier, LoggerInterface $logger)
30
+            {
29 31
                 // from the $root container
30 32
                 self::assertInstanceOf(KVLogger::class, $carrier->logger);
31 33
                 // from the $c1 container
@@ -39,7 +41,8 @@  discard block
 block discarded – undo
39 41
         $root = new Container();
40 42
         $root->bind(LoggerInterface::class, KVLogger::class);
41 43
 
42
-        $root->scope(static function (Container $c1) {
44
+        $root->scope(static function (Container $c1)
45
+        {
43 46
             $c1->bind(LoggerInterface::class, FileLogger::class);
44 47
 
45 48
             self::assertInstanceOf(
Please login to merge, or discard this patch.
src/Core/tests/Scope/FinalizeAttributeTest.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
     {
20 20
         $root = new Container();
21 21
 
22
-        $obj = $root->scope(static function (Container $c1) {
23
-            $obj = $c1->scope(static function (Container $c2) {
22
+        $obj = $root->scope(static function (Container $c1){
23
+            $obj = $c1->scope(static function (Container $c2){
24 24
                 $obj = $c2->get(AttrScopeFooFinalize::class);
25 25
 
26 26
                 self::assertFalse($obj->finalized);
@@ -73,12 +73,12 @@  discard block
 block discarded – undo
73 73
         self::expectException(FinalizersException::class);
74 74
         self::expectExceptionMessage('An exception has been thrown during finalization of the scope `foo`');
75 75
 
76
-        try {
77
-            $root->scope(static function (Container $c1) {
76
+        try{
77
+            $root->scope(static function (Container $c1){
78 78
                 $obj = $c1->get(AttrScopeFooFinalize::class);
79 79
                 $obj->throwException = true;
80 80
             }, name: 'foo');
81
-        } catch (FinalizersException $e) {
81
+        }catch (FinalizersException $e){
82 82
             self::assertSame('foo', $e->getScope());
83 83
             self::assertCount(1, $e->getExceptions());
84 84
             // Contains the message from the inner exception.
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
         self::expectException(FinalizersException::class);
102 102
         self::expectExceptionMessage('3 exceptions have been thrown during finalization of the scope `foo`');
103 103
 
104
-        try {
105
-            $root->scope(static function (Container $c1) {
104
+        try{
105
+            $root->scope(static function (Container $c1){
106 106
                 $c1->get(AttrScopeFooFinalize::class)->throwException = true;
107 107
                 $c1->get(AttrScopeFooFinalize::class)->throwException = true;
108 108
                 $c1->get(AttrScopeFooFinalize::class)->throwException = true;
109 109
             }, name: 'foo');
110
-        } catch (FinalizersException $e) {
110
+        }catch (FinalizersException $e){
111 111
             self::assertSame('foo', $e->getScope());
112 112
             self::assertCount(3, $e->getExceptions());
113 113
             // Contains the message from the inner exception.
Please login to merge, or discard this patch.
Braces   +22 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,8 +19,10 @@  discard block
 block discarded – undo
19 19
     {
20 20
         $root = new Container();
21 21
 
22
-        $obj = $root->scope(static function (Container $c1) {
23
-            $obj = $c1->scope(static function (Container $c2) {
22
+        $obj = $root->scope(static function (Container $c1)
23
+        {
24
+            $obj = $c1->scope(static function (Container $c2)
25
+            {
24 26
                 $obj = $c2->get(AttrScopeFooFinalize::class);
25 27
 
26 28
                 self::assertFalse($obj->finalized);
@@ -44,8 +46,10 @@  discard block
 block discarded – undo
44 46
         $root->bindSingleton(LoggerInterface::class, FileLogger::class);
45 47
 
46 48
         $obj2 = null;
47
-        $obj = $root->scope(static function (Container $c1) use (&$obj2) {
48
-            $obj = $c1->scope(static function (Container $c2) use (&$obj2) {
49
+        $obj = $root->scope(static function (Container $c1) use (&$obj2)
50
+        {
51
+            $obj = $c1->scope(static function (Container $c2) use (&$obj2)
52
+            {
49 53
                 $obj = $c2->get(AttrScopeFooFinalize::class);
50 54
                 $obj2 = $c2->get(AttrScopeFooFinalize::class);
51 55
 
@@ -73,12 +77,16 @@  discard block
 block discarded – undo
73 77
         self::expectException(FinalizersException::class);
74 78
         self::expectExceptionMessage('An exception has been thrown during finalization of the scope `foo`');
75 79
 
76
-        try {
77
-            $root->scope(static function (Container $c1) {
80
+        try
81
+        {
82
+            $root->scope(static function (Container $c1)
83
+            {
78 84
                 $obj = $c1->get(AttrScopeFooFinalize::class);
79 85
                 $obj->throwException = true;
80 86
             }, name: 'foo');
81
-        } catch (FinalizersException $e) {
87
+        }
88
+        catch (FinalizersException $e)
89
+        {
82 90
             self::assertSame('foo', $e->getScope());
83 91
             self::assertCount(1, $e->getExceptions());
84 92
             // Contains the message from the inner exception.
@@ -101,13 +109,17 @@  discard block
 block discarded – undo
101 109
         self::expectException(FinalizersException::class);
102 110
         self::expectExceptionMessage('3 exceptions have been thrown during finalization of the scope `foo`');
103 111
 
104
-        try {
105
-            $root->scope(static function (Container $c1) {
112
+        try
113
+        {
114
+            $root->scope(static function (Container $c1)
115
+            {
106 116
                 $c1->get(AttrScopeFooFinalize::class)->throwException = true;
107 117
                 $c1->get(AttrScopeFooFinalize::class)->throwException = true;
108 118
                 $c1->get(AttrScopeFooFinalize::class)->throwException = true;
109 119
             }, name: 'foo');
110
-        } catch (FinalizersException $e) {
120
+        }
121
+        catch (FinalizersException $e)
122
+        {
111 123
             self::assertSame('foo', $e->getScope());
112 124
             self::assertCount(3, $e->getExceptions());
113 125
             // Contains the message from the inner exception.
Please login to merge, or discard this patch.
src/Core/tests/SingletonsTest.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,8 @@  discard block
 block discarded – undo
56 56
 
57 57
         $instance = new SampleClass();
58 58
 
59
-        $container->bindSingleton('sampleClass', function () use ($instance) {
59
+        $container->bindSingleton('sampleClass', function () use ($instance)
60
+        {
60 61
             return $instance;
61 62
         });
62 63
 
@@ -67,7 +68,8 @@  discard block
 block discarded – undo
67 68
     {
68 69
         $container = new Container();
69 70
 
70
-        $container->bindSingleton('sampleClass', function () {
71
+        $container->bindSingleton('sampleClass', function ()
72
+        {
71 73
             return new SampleClass();
72 74
         });
73 75
 
@@ -130,7 +132,8 @@  discard block
 block discarded – undo
130 132
         $container = new Container();
131 133
         $container->bindSingleton('singleton', 'sampleClass');
132 134
 
133
-        $container->bind('sampleClass', function () {
135
+        $container->bind('sampleClass', function ()
136
+        {
134 137
             return new SampleClass();
135 138
         });
136 139
 
@@ -175,7 +178,8 @@  discard block
 block discarded – undo
175 178
     {
176 179
         return new
177 180
         #[Singleton]
178
-        class {
181
+        class
182
+        {
179 183
             public string $baz = 'baz';
180 184
         };
181 185
     }
Please login to merge, or discard this patch.
src/Core/tests/ScopesTest.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
 
34 34
         $this->assertNull(ContainerScope::getContainer());
35 35
 
36
-        try {
36
+        try{
37 37
             $this->assertTrue(ContainerScope::runScope($container, function () use ($container): void {
38 38
                 throw new RuntimeException('exception');
39 39
             }));
40
-        } catch (\Throwable $e) {
40
+        }catch (\Throwable $e){
41 41
         }
42 42
 
43 43
         $this->assertInstanceOf(RuntimeException::class, $e);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $this->assertTrue($c->runScope([
56 56
             'bucket' => new Bucket('b'),
57 57
             'other'  => new SampleClass()
58
-        ], function ($c) {
58
+        ], function ($c){
59 59
             $this->assertSame('b', $c->get('bucket')->getName());
60 60
             $this->assertTrue($c->has('other'));
61 61
 
@@ -77,21 +77,21 @@  discard block
 block discarded – undo
77 77
         $this->assertTrue($c->runScope([
78 78
             'bucket' => new Bucket('b'),
79 79
             'other'  => new SampleClass()
80
-        ], function ($c) {
80
+        ], function ($c){
81 81
             $this->assertSame('b', $c->get('bucket')->getName());
82 82
             $this->assertTrue($c->has('other'));
83 83
 
84 84
             return $c->get('bucket')->getName() == 'b' && $c->has('other');
85 85
         }));
86 86
 
87
-        try {
87
+        try{
88 88
             $this->assertTrue($c->runScope([
89 89
                 'bucket' => new Bucket('b'),
90 90
                 'other'  => new SampleClass()
91 91
             ], function () use ($c): void {
92 92
                 throw new RuntimeException('exception');
93 93
             }));
94
-        } catch (\Throwable $e) {
94
+        }catch (\Throwable $e){
95 95
         }
96 96
 
97 97
         $this->assertSame('a', $c->get('bucket')->getName());
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             ContainerScope::runScope($container, static fn (ContainerInterface $container) => $container)
125 125
         );
126 126
 
127
-        $result = ContainerScope::runScope($container, static function (Container $container) {
127
+        $result = ContainerScope::runScope($container, static function (Container $container){
128 128
             return $container->runScope([], static fn (Container $container) => $container);
129 129
         });
130 130
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
 
21 21
         $this->assertNull(ContainerScope::getContainer());
22 22
 
23
-        $this->assertTrue(ContainerScope::runScope($container, function () use ($container) {
23
+        $this->assertTrue(ContainerScope::runScope($container, function () use ($container)
24
+        {
24 25
             return $container === ContainerScope::getContainer();
25 26
         }));
26 27
 
@@ -33,11 +34,14 @@  discard block
 block discarded – undo
33 34
 
34 35
         $this->assertNull(ContainerScope::getContainer());
35 36
 
36
-        try {
37
+        try
38
+        {
37 39
             $this->assertTrue(ContainerScope::runScope($container, function () use ($container): void {
38 40
                 throw new RuntimeException('exception');
39 41
             }));
40
-        } catch (\Throwable $e) {
42
+        }
43
+        catch (\Throwable $e)
44
+        {
41 45
         }
42 46
 
43 47
         $this->assertInstanceOf(RuntimeException::class, $e);
@@ -55,7 +59,8 @@  discard block
 block discarded – undo
55 59
         $this->assertTrue($c->runScope([
56 60
             'bucket' => new Bucket('b'),
57 61
             'other'  => new SampleClass()
58
-        ], function ($c) {
62
+        ], function ($c)
63
+        {
59 64
             $this->assertSame('b', $c->get('bucket')->getName());
60 65
             $this->assertTrue($c->has('other'));
61 66
 
@@ -77,21 +82,25 @@  discard block
 block discarded – undo
77 82
         $this->assertTrue($c->runScope([
78 83
             'bucket' => new Bucket('b'),
79 84
             'other'  => new SampleClass()
80
-        ], function ($c) {
85
+        ], function ($c)
86
+        {
81 87
             $this->assertSame('b', $c->get('bucket')->getName());
82 88
             $this->assertTrue($c->has('other'));
83 89
 
84 90
             return $c->get('bucket')->getName() == 'b' && $c->has('other');
85 91
         }));
86 92
 
87
-        try {
93
+        try
94
+        {
88 95
             $this->assertTrue($c->runScope([
89 96
                 'bucket' => new Bucket('b'),
90 97
                 'other'  => new SampleClass()
91 98
             ], function () use ($c): void {
92 99
                 throw new RuntimeException('exception');
93 100
             }));
94
-        } catch (\Throwable $e) {
101
+        }
102
+        catch (\Throwable $e)
103
+        {
95 104
         }
96 105
 
97 106
         $this->assertSame('a', $c->get('bucket')->getName());
@@ -124,7 +133,8 @@  discard block
 block discarded – undo
124 133
             ContainerScope::runScope($container, static fn (ContainerInterface $container) => $container)
125 134
         );
126 135
 
127
-        $result = ContainerScope::runScope($container, static function (Container $container) {
136
+        $result = ContainerScope::runScope($container, static function (Container $container)
137
+        {
128 138
             return $container->runScope([], static fn (Container $container) => $container);
129 139
         });
130 140
 
Please login to merge, or discard this patch.
src/Core/tests/Scope/ScopeAttributeTest.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $root = new Container();
23 23
 
24
-        $root->scope(static function (Container $c1) {
24
+        $root->scope(static function (Container $c1){
25 25
             $c1->scope(static function (Container $c2) use ($c1) {
26 26
                 $obj1 = $c1->get(AttrScopeFooSingleton::class);
27 27
                 $obj2 = $c2->get(AttrScopeFooSingleton::class);
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
         $root = new Container();
44 44
         $root->bind('foo', self::makeFooScopeObject(...));
45 45
 
46
-        $root->scope(static function (Container $c1) {
47
-            $c1->scope(static function (Container $c2) {
46
+        $root->scope(static function (Container $c1){
47
+            $c1->scope(static function (Container $c2){
48 48
                 $c2->get('foo');
49 49
             }, name: 'foo');
50 50
         });
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
         $root = new Container();
62 62
         $root->bind('foo', self::makeFooScopeObject(...));
63 63
 
64
-        $root->scope(static function (Container $c1) {
65
-            $c1->scope(static function (Container $c2) {
64
+        $root->scope(static function (Container $c1){
65
+            $c1->scope(static function (Container $c2){
66 66
                 $c2->get('foo');
67 67
             });
68 68
         });
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
 
80 80
         $root = new Container();
81 81
 
82
-        try {
83
-            $root->scope(static function (Container $c1) {
84
-                $c1->scope(static function (Container $c2) {
85
-                    $c2->scope(static function (Container $c3) {
82
+        try{
83
+            $root->scope(static function (Container $c1){
84
+                $c1->scope(static function (Container $c2){
85
+                    $c2->scope(static function (Container $c3){
86 86
                         // do nothing
87 87
                     }, name: 'root');
88 88
                 });
89 89
             });
90
-        } catch (NamedScopeDuplicationException $e) {
90
+        }catch (NamedScopeDuplicationException $e){
91 91
             self::assertSame('root', $e->getScope());
92 92
             throw $e;
93 93
         }
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
     {
102 102
         self::expectException(BadScopeException::class);
103 103
 
104
-        try {
104
+        try{
105 105
             $root = new Container();
106
-            $root->scope(static function (Container $c1) {
107
-                $c1->scope(static function (Container $c2) {
106
+            $root->scope(static function (Container $c1){
107
+                $c1->scope(static function (Container $c2){
108 108
                     $c2->get(AttrScopeFoo::class);
109 109
                 });
110 110
             }, name: 'bar');
111
-        } catch (BadScopeException $e) {
111
+        }catch (BadScopeException $e){
112 112
             self::assertSame('foo', $e->getScope());
113 113
             throw $e;
114 114
         }
Please login to merge, or discard this patch.
Braces   +32 added lines, -15 removed lines patch added patch discarded remove patch
@@ -21,8 +21,10 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $root = new Container();
23 23
 
24
-        $root->scope(static function (Container $c1) {
25
-            $c1->scope(static function (Container $c2) use ($c1) {
24
+        $root->scope(static function (Container $c1)
25
+        {
26
+            $c1->scope(static function (Container $c2) use ($c1)
27
+            {
26 28
                 $obj1 = $c1->get(AttrScopeFooSingleton::class);
27 29
                 $obj2 = $c2->get(AttrScopeFooSingleton::class);
28 30
 
@@ -43,8 +45,10 @@  discard block
 block discarded – undo
43 45
         $root = new Container();
44 46
         $root->bind('foo', self::makeFooScopeObject(...));
45 47
 
46
-        $root->scope(static function (Container $c1) {
47
-            $c1->scope(static function (Container $c2) {
48
+        $root->scope(static function (Container $c1)
49
+        {
50
+            $c1->scope(static function (Container $c2)
51
+            {
48 52
                 $c2->get('foo');
49 53
             }, name: 'foo');
50 54
         });
@@ -61,8 +65,10 @@  discard block
 block discarded – undo
61 65
         $root = new Container();
62 66
         $root->bind('foo', self::makeFooScopeObject(...));
63 67
 
64
-        $root->scope(static function (Container $c1) {
65
-            $c1->scope(static function (Container $c2) {
68
+        $root->scope(static function (Container $c1)
69
+        {
70
+            $c1->scope(static function (Container $c2)
71
+            {
66 72
                 $c2->get('foo');
67 73
             });
68 74
         });
@@ -79,15 +85,21 @@  discard block
 block discarded – undo
79 85
 
80 86
         $root = new Container();
81 87
 
82
-        try {
83
-            $root->scope(static function (Container $c1) {
84
-                $c1->scope(static function (Container $c2) {
85
-                    $c2->scope(static function (Container $c3) {
88
+        try
89
+        {
90
+            $root->scope(static function (Container $c1)
91
+            {
92
+                $c1->scope(static function (Container $c2)
93
+                {
94
+                    $c2->scope(static function (Container $c3)
95
+                    {
86 96
                         // do nothing
87 97
                     }, name: 'root');
88 98
                 });
89 99
             });
90
-        } catch (NamedScopeDuplicationException $e) {
100
+        }
101
+        catch (NamedScopeDuplicationException $e)
102
+        {
91 103
             self::assertSame('root', $e->getScope());
92 104
             throw $e;
93 105
         }
@@ -101,14 +113,19 @@  discard block
 block discarded – undo
101 113
     {
102 114
         self::expectException(BadScopeException::class);
103 115
 
104
-        try {
116
+        try
117
+        {
105 118
             $root = new Container();
106
-            $root->scope(static function (Container $c1) {
107
-                $c1->scope(static function (Container $c2) {
119
+            $root->scope(static function (Container $c1)
120
+            {
121
+                $c1->scope(static function (Container $c2)
122
+                {
108 123
                     $c2->get(AttrScopeFoo::class);
109 124
                 });
110 125
             }, name: 'bar');
111
-        } catch (BadScopeException $e) {
126
+        }
127
+        catch (BadScopeException $e)
128
+        {
112 129
             self::assertSame('foo', $e->getScope());
113 130
             throw $e;
114 131
         }
Please login to merge, or discard this patch.