Passed
Pull Request — master (#14)
by Koldo
11:49 queued 02:36
created
src/ContainerBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
             $containerConfig[$name] = $service;
34 34
         }
35 35
         foreach ($dependencies['dependencies']['factories'] ?? [] as $name => $factory) {
36
-            $containerConfig[$name] = static function (ContainerInterface $container) use ($factory) {
36
+            $containerConfig[$name] = static function(ContainerInterface $container) use ($factory) {
37 37
                 if (is_array($factory)) {
38 38
                     $class = array_shift($factory);
39 39
                     $instance = new $class();
Please login to merge, or discard this patch.
tests/ContainerBuilderTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
         $container = ContainerBuilder::build([
72 72
             'dependencies' => [
73 73
                 'factories' => [
74
-                    'some.test.class' => function (ContainerInterface $container) {
74
+                    'some.test.class' => function(ContainerInterface $container) {
75 75
                         return new \SplStack();
76 76
                     },
77 77
                 ]
Please login to merge, or discard this patch.
src/InstanceResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
 
62 62
         $parameters = (new ReflectionMethod($className, '__construct'))->getParameters();
63 63
 
64
-        $this->parameters->set($id, array_map(function (ReflectionParameter $parameter) use ($id) {
64
+        $this->parameters->set($id, array_map(function(ReflectionParameter $parameter) use ($id) {
65 65
             return $this->makeParameter($id, $parameter);
66 66
         }, $parameters));
67 67
 
Please login to merge, or discard this patch.
src/MarshalDelegatorsConfig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
             if (!is_callable($factory)) {
17 17
                 continue;
18 18
             }
19
-            $dependencies->set(ContainerDelegatorFactory::class, static function () use ($delegatorNames, $factory) {
19
+            $dependencies->set(ContainerDelegatorFactory::class, static function() use ($delegatorNames, $factory) {
20 20
                 return new ContainerDelegatorFactory($delegatorNames, $factory);
21 21
             });
22 22
             $dependencies->set(
23 23
                 $service,
24
-                static function (ContainerInterface $container) use ($service) {
24
+                static function(ContainerInterface $container) use ($service) {
25 25
                     $callable = $container->get(ContainerDelegatorFactory::class);
26 26
                     return $callable($container, $service);
27 27
                 }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         }
41 41
         // Marshal from factory
42 42
         $serviceFactory = $dependencies->get($service);
43
-        return static function (ContainerInterface $container) use ($service, $serviceFactory) {
43
+        return static function(ContainerInterface $container) use ($service, $serviceFactory) {
44 44
             return is_callable($serviceFactory)
45 45
                 ? $serviceFactory($container, $service)
46 46
                 : (new $serviceFactory())($container, $service);
Please login to merge, or discard this patch.
src/ContainerDelegatorFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,14 +66,14 @@
 block discarded – undo
66 66
 
67 67
         return array_reduce(
68 68
             $this->delegators,
69
-            static function ($instance, $delegatorName) use ($serviceName, $container) {
69
+            static function($instance, $delegatorName) use ($serviceName, $container) {
70 70
                 if (is_string($delegatorName) && $container->has($delegatorName)) {
71 71
                     $delegatorName = $container->get($delegatorName);
72 72
                 }
73 73
 
74 74
                 $delegator = is_callable($delegatorName) ? $delegatorName : new $delegatorName();
75 75
 
76
-                return $delegator($container, $serviceName, static function () use ($instance) {
76
+                return $delegator($container, $serviceName, static function() use ($instance) {
77 77
                     return $instance;
78 78
                 });
79 79
             },
Please login to merge, or discard this patch.
tests/ContainerTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         $container = new Container(new ContainerConfig([
39 39
             'config' => [],
40 40
             'parameters' => [],
41
-            'some.service' => function (ContainerInterface $container) {
41
+            'some.service' => function(ContainerInterface $container) {
42 42
                 $this->assertInstanceOf(Container::class, $container);
43 43
                 return new SplObjectStorage();
44 44
             },
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $container = new Container(new ContainerConfig([
65 65
             'config' => [],
66 66
             'parameters' => [],
67
-            'some.service' => function (ContainerInterface $container) {
67
+            'some.service' => function(ContainerInterface $container) {
68 68
                 $this->assertInstanceOf(Container::class, $container);
69 69
                 return new SplObjectStorage();
70 70
             },
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                     'bazz' => ['Hello World']
87 87
                 ],
88 88
             ],
89
-            'some.service' => function (ContainerInterface $container) {
89
+            'some.service' => function(ContainerInterface $container) {
90 90
                 $this->assertInstanceOf(Container::class, $container);
91 91
                 return new SplObjectStorage();
92 92
             },
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
         $container = new Container(new ContainerConfig([
145 145
             'config' => [],
146 146
             'parameters' => [],
147
-            'some.service' => function () {
147
+            'some.service' => function() {
148 148
                 return new\SplStack();
149 149
             },
150
-            'some.service.delegator.factory' => function () {
151
-                return function (ContainerInterface $container, string $name, callable $callback): \SplStack {
150
+            'some.service.delegator.factory' => function() {
151
+                return function(ContainerInterface $container, string $name, callable $callback): \SplStack {
152 152
                     /** @var \SplStack $stack */
153 153
                     $stack = $callback();
154 154
                     $stack->push('Hello World!!!');
Please login to merge, or discard this patch.
tests/MarshalDelegatorsConfigTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
             'some.service' => \SplStack::class,
22 22
             'delegators' => [
23 23
                 'some.service' => [
24
-                    function (ContainerInterface $container, string $name, callable $callback): \SplStack {
24
+                    function(ContainerInterface $container, string $name, callable $callback): \SplStack {
25 25
                         /** @var \SplStack $stack */
26 26
                         $stack = $callback();
27 27
                         $stack->push('Hello World!!!');
Please login to merge, or discard this patch.
tests/BuilderTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $this->expectException(InvalidArgumentException::class);
30 30
         ContainerBuilder::build([
31 31
             'services' => [
32
-                'some.service' => function () {
32
+                'some.service' => function() {
33 33
                 }
34 34
             ],
35 35
             'factories' => [],
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         ContainerBuilder::build([
44 44
             'services' => [
45 45
                 'some.service' => [
46
-                    'class' => function () {
46
+                    'class' => function() {
47 47
                     }
48 48
                 ]
49 49
             ],
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         ContainerBuilder::build([
59 59
             'services' => [
60 60
                 'some.service' => [
61
-                    function () {
61
+                    function() {
62 62
                     }
63 63
                 ]
64 64
             ],
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     {
111 111
         $container = ContainerBuilder::build([
112 112
             'factories' => [
113
-                'some.test.class' => function (ContainerInterface $container) {
113
+                'some.test.class' => function(ContainerInterface $container) {
114 114
                     return new SplStack();
115 115
                 },
116 116
             ],
Please login to merge, or discard this patch.
src/Builder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         );
45 45
 
46 46
         foreach ($factories as $name => $factory) {
47
-            $containerConfig[$name] = static function (ContainerInterface $container) use ($factory) {
47
+            $containerConfig[$name] = static function(ContainerInterface $container) use ($factory) {
48 48
                 if (is_array($factory)) {
49 49
                     $class = array_shift($factory);
50 50
                     $instance = new $class();
Please login to merge, or discard this patch.