Passed
Pull Request — master (#1065)
by Maxim
17:56 queued 06:27
created
src/Core/tests/Scope/UseCaseTest.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $root = new Container();
31 31
         $root->bind('foo', SampleClass::class);
32 32
 
33
-        $root->runScoped(function (ContainerInterface $c1) {
33
+        $root->runScoped(function (ContainerInterface $c1){
34 34
             $c1->get('foo');
35 35
         }, bindings: ['foo' => SampleClass::class]);
36 36
 
@@ -297,20 +297,20 @@  discard block
 block discarded – undo
297 297
         $root = new Container();
298 298
         $root->bindSingleton('sampleClass', SampleClass::class);
299 299
 
300
-        $root->runScope(new Scope('foo'), function (Container $container) {
300
+        $root->runScope(new Scope('foo'), function (Container $container){
301 301
             $this->assertTrue($container->has('sampleClass'));
302 302
         });
303 303
 
304
-        $root->runScope(new Scope('foo'), function (Container $container) {
305
-            $container->runScope(new Scope('bar'), function (Container $container) {
304
+        $root->runScope(new Scope('foo'), function (Container $container){
305
+            $container->runScope(new Scope('bar'), function (Container $container){
306 306
                 $this->assertTrue($container->has('sampleClass'));
307 307
             });
308 308
         });
309 309
 
310
-        $root->runScope(new Scope('foo'), function (Container $container) {
310
+        $root->runScope(new Scope('foo'), function (Container $container){
311 311
             $container->bindSingleton('otherClass', SampleClass::class);
312 312
 
313
-            $container->runScope(new Scope('bar'), function (Container $container) {
313
+            $container->runScope(new Scope('bar'), function (Container $container){
314 314
                 $this->assertTrue($container->has('sampleClass'));
315 315
                 $this->assertTrue($container->has('otherClass'));
316 316
             });
@@ -322,33 +322,33 @@  discard block
 block discarded – undo
322 322
         $root = new Container();
323 323
         $root->getBinder('foo')->bindSingleton('sampleClass', AttrScopeFoo::class);
324 324
 
325
-        $root->runScope(new Scope('foo'), function (Container $container) {
325
+        $root->runScope(new Scope('foo'), function (Container $container){
326 326
             $this->assertTrue($container->has('sampleClass'));
327 327
         });
328 328
 
329
-        $root->runScope(new Scope('bar'), function (Container $container) {
329
+        $root->runScope(new Scope('bar'), function (Container $container){
330 330
             $this->assertFalse($container->has('sampleClass'));
331 331
         });
332 332
 
333
-        $root->runScope(new Scope('foo'), function (Container $container) {
334
-            $container->runScope(new Scope('bar'), function (Container $container) {
333
+        $root->runScope(new Scope('foo'), function (Container $container){
334
+            $container->runScope(new Scope('bar'), function (Container $container){
335 335
                 $this->assertTrue($container->has('sampleClass'));
336 336
             });
337 337
         });
338 338
 
339
-        $root->runScope(new Scope('foo'), function (Container $container) {
339
+        $root->runScope(new Scope('foo'), function (Container $container){
340 340
             $container->bindSingleton('otherClass', AttrScopeFoo::class);
341 341
 
342
-            $container->runScope(new Scope('bar'), function (Container $container) {
342
+            $container->runScope(new Scope('bar'), function (Container $container){
343 343
                 $this->assertTrue($container->has('sampleClass'));
344 344
                 $this->assertTrue($container->has('otherClass'));
345 345
             });
346 346
         });
347 347
 
348
-        $root->runScope(new Scope('baz'), function (Container $container) {
348
+        $root->runScope(new Scope('baz'), function (Container $container){
349 349
             $container->getBinder('foo')->bindSingleton('otherClass', AttrScopeFoo::class);
350 350
 
351
-            $container->runScope(new Scope('bar'), function (Container $container) {
351
+            $container->runScope(new Scope('bar'), function (Container $container){
352 352
                 $this->assertFalse($container->has('sampleClass'));
353 353
                 $this->assertFalse($container->has('otherClass'));
354 354
             });
Please login to merge, or discard this patch.
src/Core/src/Internal/Container.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     use DestructorTrait;
20 20
 
21 21
     private State $state;
22
-    private FactoryInterface|Factory $factory;
22
+    private FactoryInterface | Factory $factory;
23 23
     private Scope $scope;
24 24
 
25 25
     public function __construct(Registry $constructor)
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
      * @throws ContainerException
50 50
      * @throws \Throwable
51 51
      */
52
-    public function get(string|Autowire $id, \Stringable|string|null $context = null): mixed
52
+    public function get(string | Autowire $id, \Stringable | string | null $context = null): mixed
53 53
     {
54
-        if ($id instanceof Autowire) {
54
+        if ($id instanceof Autowire){
55 55
             return $id->resolve($this->factory);
56 56
         }
57 57
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function has(string $id): bool
63 63
     {
64
-        if (\array_key_exists($id, $this->state->bindings) || \array_key_exists($id, $this->state->singletons)) {
64
+        if (\array_key_exists($id, $this->state->bindings) || \array_key_exists($id, $this->state->singletons)){
65 65
             return true;
66 66
         }
67 67
 
Please login to merge, or discard this patch.
src/Framework/Console/Logger/DebugListener.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function __construct(
29 29
         private readonly ListenerRegistryInterface $listenerRegistry
30
-    ) {
30
+    ){
31 31
     }
32 32
 
33 33
     /**
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function __invoke(LogEvent $event): void
37 37
     {
38
-        if (empty($this->output)) {
38
+        if (empty($this->output)){
39 39
             return;
40 40
         }
41 41
 
42
-        if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) {
42
+        if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE){
43 43
             return;
44 44
         }
45 45
 
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 
97 97
     private function getChannel(string $channel): string
98 98
     {
99
-        if (!\class_exists($channel, false)) {
99
+        if (!\class_exists($channel, false)){
100 100
             return \sprintf('[%s]', $channel);
101 101
         }
102 102
 
103
-        try {
103
+        try{
104 104
             $reflection = new \ReflectionClass($channel);
105
-        } catch (\ReflectionException) {
105
+        }catch (\ReflectionException){
106 106
             return $channel;
107 107
         }
108 108
 
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
 
112 112
     private function getMessage(bool $decorated, string $message): string
113 113
     {
114
-        if (!$decorated) {
114
+        if (!$decorated){
115 115
             return $message;
116 116
         }
117 117
 
118
-        return Color::GRAY . $message . Color::RESET;
118
+        return Color::GRAY.$message.Color::RESET;
119 119
     }
120 120
 }
Please login to merge, or discard this patch.