@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | private function resolveArgument($argument, $class) |
| 147 | 147 | { |
| 148 | - if($class && is_string($argument)) { |
|
| 148 | + if ($class && is_string($argument)) { |
|
| 149 | 149 | return $this->resolve($argument); |
| 150 | 150 | } |
| 151 | 151 | return $argument; |
@@ -200,8 +200,8 @@ discard block |
||
| 200 | 200 | private function injectAttributed(mixed $instance, \ReflectionClass $reflection): void |
| 201 | 201 | { |
| 202 | 202 | // Properties |
| 203 | - foreach($reflection->getProperties() as $property) { |
|
| 204 | - if (count($property->getAttributes(Inject::class)) == 0 ) { |
|
| 203 | + foreach ($reflection->getProperties() as $property) { |
|
| 204 | + if (count($property->getAttributes(Inject::class)) == 0) { |
|
| 205 | 205 | continue; |
| 206 | 206 | } |
| 207 | 207 | $type = $property->getType(); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | // Methods |
| 220 | - foreach($reflection->getMethods() as $method) { |
|
| 220 | + foreach ($reflection->getMethods() as $method) { |
|
| 221 | 221 | if (count($method->getAttributes(Inject::class)) == 0) { |
| 222 | 222 | continue; |
| 223 | 223 | } |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @return mixed |
| 234 | 234 | * @throws exceptions\ResolutionException |
| 235 | 235 | */ |
| 236 | - private function getInstance(string|callable $class): mixed |
|
| 236 | + private function getInstance(string | callable $class): mixed |
|
| 237 | 237 | { |
| 238 | 238 | // If the class is a function call it as a factory. |
| 239 | 239 | if (is_callable($class)) { |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | * @param mixed $value |
| 41 | 41 | * @return self |
| 42 | 42 | */ |
| 43 | - public function to(string|array|callable $value): Bindings |
|
| 43 | + public function to(string | array | callable $value): Bindings |
|
| 44 | 44 | { |
| 45 | - if(isset($this->bindings[$this->activeKey])) { |
|
| 45 | + if (isset($this->bindings[$this->activeKey])) { |
|
| 46 | 46 | $this->bindings[$this->activeKey]['binding'] = $value; |
| 47 | 47 | } else { |
| 48 | 48 | $this->bindings[$this->activeKey] = ['binding' => $value, 'calls' => [], 'properties' => []]; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function get(string $key): array |
| 60 | 60 | { |
| 61 | 61 | $binding = $this->bindings[$key]; |
| 62 | - if(!isset($binding['binding'])) { |
|
| 62 | + if (!isset($binding['binding'])) { |
|
| 63 | 63 | $binding['binding'] = $key; |
| 64 | 64 | } |
| 65 | 65 | return $binding; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | private function setArrayBinding(array $binding): void |
| 95 | 95 | { |
| 96 | - if(isset($binding[0])) { |
|
| 96 | + if (isset($binding[0])) { |
|
| 97 | 97 | $this->to($binding[0]); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function merge(array $bindings): void |
| 109 | 109 | { |
| 110 | - foreach($bindings as $key => $binding) { |
|
| 110 | + foreach ($bindings as $key => $binding) { |
|
| 111 | 111 | $this->activeKey = $key; |
| 112 | - if(is_array($binding)) { |
|
| 112 | + if (is_array($binding)) { |
|
| 113 | 113 | $this->setArrayBinding($binding); |
| 114 | 114 | } else { |
| 115 | 115 | $this->bindings[$key] = ['binding' => $binding, 'calls' => [], 'properties' => []]; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | return $this; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - public function with(string|array|callable $value): Bindings |
|
| 126 | + public function with(string | array | callable $value): Bindings |
|
| 127 | 127 | { |
| 128 | 128 | return $this->to($value); |
| 129 | 129 | } |