Completed
Push — master ( 3046ca...6411fa )
by Jesse
02:05
created
src/Container.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,16 +85,24 @@
 block discarded – undo
85 85
     /** @throws ServiceNotFound */
86 86
     private function mustKnowAbout(string $theService) : void
87 87
     {
88
-        if ($this->has($theService)) return;
88
+        if ($this->has($theService)) {
89
+            return;
90
+        }
89 91
         throw ServiceNotFound::noServiceNamed($theService);
90 92
     }
91 93
 
92 94
     /** @throws InvalidServiceDefinition */
93 95
     private function typeMustCheckOut(string $serviceName, $service, string $requiredType) : void
94 96
     {
95
-        if (empty($requiredType)) return;
96
-        if (gettype($service) === $requiredType) return;
97
-        if ($service instanceof $requiredType) return;
97
+        if (empty($requiredType)) {
98
+            return;
99
+        }
100
+        if (gettype($service) === $requiredType) {
101
+            return;
102
+        }
103
+        if ($service instanceof $requiredType) {
104
+            return;
105
+        }
98 106
         throw InvalidServiceType::serviceIsNotOfType($serviceName, $requiredType);
99 107
     }
100 108
 }
Please login to merge, or discard this patch.
src/ArrayAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
Please login to merge, or discard this patch.
src/ContainerInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
Please login to merge, or discard this patch.
src/InvalidServiceType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
Please login to merge, or discard this patch.
src/ServiceNotFound.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
Please login to merge, or discard this patch.
src/InvalidServiceDefinition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
Please login to merge, or discard this patch.
src/AutoWiring.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         if (interface_exists($service)) {
49 49
             $this->resolveInterface($service);
50
-        } else if(class_exists($service)) {
50
+        } else if (class_exists($service)) {
51 51
             $this->resolveClass($service);
52 52
         } else {
53 53
             throw ServiceNotFound::noServiceNamed($service);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $class = $this->links[$service];
60 60
         $this->resolveClass($class);
61
-        $this->container->set($service, function () use ($class) {
61
+        $this->container->set($service, function() use ($class) {
62 62
             return $this->container->get($class);
63 63
         });
64 64
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             }
76 76
         }
77 77
         $this->container->set($service,
78
-            function () use ($service, $dependencies) {
78
+            function() use ($service, $dependencies) {
79 79
                 $parameters = [];
80 80
                 foreach ($dependencies as $dependency) {
81 81
                     $parameters[] = $this->container->get($dependency);
Please login to merge, or discard this patch.
src/InvalidFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
Please login to merge, or discard this patch.
src/DependenciesCannotBeCircular.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Stratadox\Di;
6 6
 
Please login to merge, or discard this patch.