@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | |
20 | 20 | public function obtener(string $abstract) |
21 | 21 | { |
22 | - if(interface_exists($abstract)) |
|
22 | + if (interface_exists($abstract)) |
|
23 | 23 | { |
24 | 24 | $interface = explode('\\', $abstract); |
25 | 25 | $abstract = $this->_rutas[$interface[1]]; |
26 | 26 | } |
27 | 27 | |
28 | - if(isset($this->_bindings[$abstract])) |
|
28 | + if (isset($this->_bindings[$abstract])) |
|
29 | 29 | { |
30 | 30 | return $this->_bindings[$abstract]($this); |
31 | 31 | } |
@@ -39,16 +39,16 @@ discard block |
||
39 | 39 | |
40 | 40 | private function buildDependencies(ReflectionClass $reflection): array |
41 | 41 | { |
42 | - if(!$constructor = $reflection->getConstructor()) |
|
42 | + if (!$constructor = $reflection->getConstructor()) |
|
43 | 43 | { |
44 | 44 | return []; |
45 | 45 | } |
46 | 46 | |
47 | 47 | $params = $constructor->getParameters(); |
48 | 48 | |
49 | - return array_map(function ($param) |
|
49 | + return array_map(function($param) |
|
50 | 50 | { |
51 | - if(!$type = $param->getType()) |
|
51 | + if (!$type = $param->getType()) |
|
52 | 52 | { |
53 | 53 | throw new RuntimeException(); |
54 | 54 | } |
@@ -3,5 +3,5 @@ |
||
3 | 3 | |
4 | 4 | interface ContenedorInterface |
5 | 5 | { |
6 | - public function obtener(string $abstract); |
|
6 | + public function obtener(string $abstract); |
|
7 | 7 | } |
8 | 8 | \ No newline at end of file |
@@ -3,8 +3,8 @@ |
||
3 | 3 | |
4 | 4 | class SegundaClase |
5 | 5 | { |
6 | - public function holaMundo(): string |
|
7 | - { |
|
8 | - return 'Hola Mundo'; |
|
9 | - } |
|
6 | + public function holaMundo(): string |
|
7 | + { |
|
8 | + return 'Hola Mundo'; |
|
9 | + } |
|
10 | 10 | } |
11 | 11 | \ No newline at end of file |
@@ -4,11 +4,11 @@ |
||
4 | 4 | |
5 | 5 | class PrimerClase |
6 | 6 | { |
7 | - public function __construct |
|
8 | - ( |
|
9 | - SegundaClase $SegundaClase |
|
10 | - ) |
|
11 | - { |
|
12 | - echo $SegundaClase->holaMundo(); |
|
13 | - } |
|
7 | + public function __construct |
|
8 | + ( |
|
9 | + SegundaClase $SegundaClase |
|
10 | + ) |
|
11 | + { |
|
12 | + echo $SegundaClase->holaMundo(); |
|
13 | + } |
|
14 | 14 | } |
15 | 15 | \ No newline at end of file |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | class PrimerClase |
6 | 6 | { |
7 | - public function __construct |
|
8 | - ( |
|
7 | + public function __construct( |
|
9 | 8 | SegundaClase $SegundaClase |
10 | 9 | ) |
11 | 10 | { |