Passed
Pull Request — master (#844)
by Maxim
09:33 queued 02:41
created
src/Core/src/Container.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
     use DestructorTrait;
45 45
 
46 46
     private Internal\State $state;
47
-    private ResolverInterface|Internal\Resolver $resolver;
48
-    private FactoryInterface|Internal\Factory $factory;
49
-    private ContainerInterface|Internal\Container $container;
50
-    private BinderInterface|Internal\Binder $binder;
51
-    private InvokerInterface|Internal\Invoker $invoker;
47
+    private ResolverInterface | Internal\Resolver $resolver;
48
+    private FactoryInterface | Internal\Factory $factory;
49
+    private ContainerInterface | Internal\Container $container;
50
+    private BinderInterface | Internal\Binder $binder;
51
+    private InvokerInterface | Internal\Invoker $invoker;
52 52
     private Internal\Tracer $tracer;
53 53
 
54 54
     /**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $constructor = new Internal\Registry($config, [
60 60
             'state' => new Internal\State(),
61 61
         ]);
62
-        foreach ($config as $property => $class) {
62
+        foreach ($config as $property => $class){
63 63
             $this->$property = $constructor->get($property, $class);
64 64
         }
65 65
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      *
131 131
      * @psalm-suppress PossiblyInvalidArgument, PossiblyInvalidCast
132 132
      */
133
-    public function get(string|Autowire $id, string $context = null): mixed
133
+    public function get(string | Autowire $id, string $context = null): mixed
134 134
     {
135 135
         return $this->container->get($id, $context);
136 136
     }
@@ -144,26 +144,26 @@  discard block
 block discarded – undo
144 144
     {
145 145
         $binds = &$this->state->bindings;
146 146
         $cleanup = $previous = [];
147
-        foreach ($bindings as $alias => $resolver) {
148
-            if (isset($binds[$alias])) {
147
+        foreach ($bindings as $alias => $resolver){
148
+            if (isset($binds[$alias])){
149 149
                 $previous[$alias] = $binds[$alias];
150
-            } else {
150
+            }else{
151 151
                 $cleanup[] = $alias;
152 152
             }
153 153
 
154 154
             $this->binder->bind($alias, $resolver);
155 155
         }
156 156
 
157
-        try {
157
+        try{
158 158
             return ContainerScope::getContainer() !== $this
159 159
                 ? ContainerScope::runScope($this, $scope)
160 160
                 : $scope($this);
161
-        } finally {
162
-            foreach ($previous as $alias => $resolver) {
161
+        }finally{
162
+            foreach ($previous as $alias => $resolver){
163 163
                 $binds[$alias] = $resolver;
164 164
             }
165 165
 
166
-            foreach ($cleanup as $alias) {
166
+            foreach ($cleanup as $alias){
167 167
                 unset($binds[$alias]);
168 168
             }
169 169
         }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      * for each method call), function array or Closure (executed every call). Only object resolvers
175 175
      * supported by this method.
176 176
      */
177
-    public function bind(string $alias, string|array|callable|object $resolver): void
177
+    public function bind(string $alias, string | array | callable | object $resolver): void
178 178
     {
179 179
         $this->binder->bind($alias, $resolver);
180 180
     }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      *
186 186
      * @psalm-param TResolver $resolver
187 187
      */
188
-    public function bindSingleton(string $alias, string|array|callable|object $resolver): void
188
+    public function bindSingleton(string $alias, string | array | callable | object $resolver): void
189 189
     {
190 190
         $this->binder->bindSingleton($alias, $resolver);
191 191
     }
Please login to merge, or discard this patch.