@@ -44,8 +44,8 @@ |
||
44 | 44 | $this->context = $context; |
45 | 45 | |
46 | 46 | $name = $context->getName(); |
47 | - if ($context instanceof ReflectionMethod) { |
|
48 | - $name = $context->class . '::' . $name; |
|
47 | + if ($context instanceof ReflectionMethod){ |
|
48 | + $name = $context->class.'::'.$name; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | parent::__construct("Unable to resolve '{$parameter->name}' argument in '{$name}'"); |
@@ -44,7 +44,8 @@ |
||
44 | 44 | $this->context = $context; |
45 | 45 | |
46 | 46 | $name = $context->getName(); |
47 | - if ($context instanceof ReflectionMethod) { |
|
47 | + if ($context instanceof ReflectionMethod) |
|
48 | + { |
|
48 | 49 | $name = $context->class . '::' . $name; |
49 | 50 | } |
50 | 51 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | */ |
72 | 72 | public function offsetGet($offset) |
73 | 73 | { |
74 | - if (!$this->offsetExists($offset)) { |
|
74 | + if (!$this->offsetExists($offset)){ |
|
75 | 75 | throw new ConfigException("Undefined configuration key '{$offset}'"); |
76 | 76 | } |
77 | 77 |
@@ -71,7 +71,8 @@ |
||
71 | 71 | */ |
72 | 72 | public function offsetGet($offset) |
73 | 73 | { |
74 | - if (!$this->offsetExists($offset)) { |
|
74 | + if (!$this->offsetExists($offset)) |
|
75 | + { |
|
75 | 76 | throw new ConfigException("Undefined configuration key '{$offset}'"); |
76 | 77 | } |
77 | 78 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function resolveAlias(string $alias): string |
26 | 26 | { |
27 | - while (is_string($alias) && isset($this->config) && isset($this->config['aliases'][$alias])) { |
|
27 | + while (is_string($alias) && isset($this->config) && isset($this->config['aliases'][$alias])){ |
|
28 | 28 | $alias = $this->config['aliases'][$alias]; |
29 | 29 | } |
30 | 30 |
@@ -24,7 +24,8 @@ |
||
24 | 24 | */ |
25 | 25 | public function resolveAlias(string $alias): string |
26 | 26 | { |
27 | - while (is_string($alias) && isset($this->config) && isset($this->config['aliases'][$alias])) { |
|
27 | + while (is_string($alias) && isset($this->config) && isset($this->config['aliases'][$alias])) |
|
28 | + { |
|
28 | 29 | $alias = $this->config['aliases'][$alias]; |
29 | 30 | } |
30 | 31 |
@@ -58,22 +58,22 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public static function wire($definition): Autowire |
60 | 60 | { |
61 | - if ($definition instanceof self) { |
|
61 | + if ($definition instanceof self){ |
|
62 | 62 | return $definition; |
63 | 63 | } |
64 | 64 | |
65 | - if (is_string($definition)) { |
|
65 | + if (is_string($definition)){ |
|
66 | 66 | return new Autowire($definition); |
67 | 67 | } |
68 | 68 | |
69 | - if (is_array($definition) && isset($definition['class'])) { |
|
69 | + if (is_array($definition) && isset($definition['class'])){ |
|
70 | 70 | return new Autowire( |
71 | 71 | $definition['class'], |
72 | 72 | $definition['options'] ?? $definition['params'] ?? [] |
73 | 73 | ); |
74 | 74 | } |
75 | 75 | |
76 | - if (is_object($definition)) { |
|
76 | + if (is_object($definition)){ |
|
77 | 77 | $autowire = new self(get_class($definition), []); |
78 | 78 | $autowire->target = $definition; |
79 | 79 | return $autowire; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function resolve(FactoryInterface $factory, array $parameters = []) |
94 | 94 | { |
95 | - if ($this->target !== null) { |
|
95 | + if ($this->target !== null){ |
|
96 | 96 | // pre-wired |
97 | 97 | return $this->target; |
98 | 98 | } |
@@ -58,22 +58,26 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public static function wire($definition): Autowire |
60 | 60 | { |
61 | - if ($definition instanceof self) { |
|
61 | + if ($definition instanceof self) |
|
62 | + { |
|
62 | 63 | return $definition; |
63 | 64 | } |
64 | 65 | |
65 | - if (is_string($definition)) { |
|
66 | + if (is_string($definition)) |
|
67 | + { |
|
66 | 68 | return new Autowire($definition); |
67 | 69 | } |
68 | 70 | |
69 | - if (is_array($definition) && isset($definition['class'])) { |
|
71 | + if (is_array($definition) && isset($definition['class'])) |
|
72 | + { |
|
70 | 73 | return new Autowire( |
71 | 74 | $definition['class'], |
72 | 75 | $definition['options'] ?? $definition['params'] ?? [] |
73 | 76 | ); |
74 | 77 | } |
75 | 78 | |
76 | - if (is_object($definition)) { |
|
79 | + if (is_object($definition)) |
|
80 | + { |
|
77 | 81 | $autowire = new self(get_class($definition), []); |
78 | 82 | $autowire->target = $definition; |
79 | 83 | return $autowire; |
@@ -92,7 +96,8 @@ discard block |
||
92 | 96 | */ |
93 | 97 | public function resolve(FactoryInterface $factory, array $parameters = []) |
94 | 98 | { |
95 | - if ($this->target !== null) { |
|
99 | + if ($this->target !== null) |
|
100 | + { |
|
96 | 101 | // pre-wired |
97 | 102 | return $this->target; |
98 | 103 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $parameters->set(Option::PACKAGE_ALIAS_FORMAT, '<major>.<minor>.x-dev'); |
37 | 37 | |
38 | 38 | $parameters->set(Option::PACKAGE_DIRECTORIES, [ |
39 | - __DIR__ . '/src' |
|
39 | + __DIR__.'/src' |
|
40 | 40 | ]); |
41 | 41 | |
42 | 42 | $parameters->set(Option::DATA_TO_APPEND, [ |
@@ -100,6 +100,6 @@ discard block |
||
100 | 100 | ]); |
101 | 101 | |
102 | 102 | $parameters->set(Option::DIRECTORIES_TO_REPOSITORIES, [ |
103 | - __DIR__ . '/src/Core' => '[email protected]:spiral/core.git' |
|
103 | + __DIR__.'/src/Core' => '[email protected]:spiral/core.git' |
|
104 | 104 | ]); |
105 | 105 | }; |