Completed
Push — master ( 947d3c...cb14bc )
by Taosikai
14:43 queued 02:08
created
Tests/ContainerTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     public function testDelegate()
27 27
     {
28 28
         $container = $this->getContainer();
29
-        $container->delegate('director1', function () {
29
+        $container->delegate('director1', function() {
30 30
             return new Director('James', 26);
31 31
         });
32 32
         $this->assertInstanceOf(Director::class, $container->get('director1'));
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     public function testShare()
159 159
     {
160 160
         $container = $this->getContainer();
161
-        $container->delegate('director', function () {
161
+        $container->delegate('director', function() {
162 162
             return new Director('James', 26);
163 163
         });
164 164
         $container->share('director');
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $this->assertTrue($container->get('director') === $container->get('director'));
167 167
 
168 168
         //兼容旧的api,已提示废除
169
-        $container->share('director2', function () {
169
+        $container->share('director2', function() {
170 170
             return new Director('James', 26);
171 171
         });
172 172
         $this->assertTrue($container->get('director2') === $container->get('director2'));
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     {
177 177
         $container = $this->getContainer();
178 178
         //Similar to delegate
179
-        $container->set('director', function () {
179
+        $container->set('director', function() {
180 180
             return new Director('James', 26);
181 181
         });
182 182
         $this->assertInstanceOf(Director::class, $container->get('director'));
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     {
206 206
         $container = $this->getContainer();
207 207
         //Similar to delegate
208
-        $container->set('director', function () {
208
+        $container->set('director', function() {
209 209
             return new Director('James', 26);
210 210
         }, true);
211 211
         $this->assertInstanceOf(Director::class, $container->get('director'));
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         $container->setParameters([
268 268
             'directorName' => 'James'
269 269
         ]);
270
-        $container->delegate('director', function (Container $container) {
270
+        $container->delegate('director', function(Container $container) {
271 271
             return new Director($container->getParameter('directorName'), 26);
272 272
         });
273 273
         $this->assertEquals('James', $container->get('director')->getName());
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         $container = $this->getContainer();
279 279
         $container->setParameters([
280 280
             'directorName' => 'James',
281
-            'director' => [ //支持点号获取深度数据结构
281
+            'director' => [//支持点号获取深度数据结构
282 282
                 'age' => 26
283 283
             ]
284 284
         ]);
Please login to merge, or discard this patch.