| @@ 24-35 (lines=12) @@ | ||
| 21 | /** |
|
| 22 | * Build the injector using the provided configuration. |
|
| 23 | */ |
|
| 24 | public function build(Injector $injector = null): Injector |
|
| 25 | { |
|
| 26 | if ($injector === null) { |
|
| 27 | $injector = new Injector(); |
|
| 28 | } |
|
| 29 | ||
| 30 | foreach ($this->configs as $config) { |
|
| 31 | $config->apply($injector); |
|
| 32 | } |
|
| 33 | ||
| 34 | return $injector; |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 24-35 (lines=12) @@ | ||
| 21 | /** |
|
| 22 | * Build the injector using the provided configuration. |
|
| 23 | */ |
|
| 24 | public function build(Injector $injector = null): Injector |
|
| 25 | { |
|
| 26 | if (empty($injector)) { |
|
| 27 | $injector = new Injector(); |
|
| 28 | } |
|
| 29 | ||
| 30 | foreach ($this->configs as $config) { |
|
| 31 | $this->makeConfig($injector, $config)->apply($injector); |
|
| 32 | } |
|
| 33 | ||
| 34 | return $injector; |
|
| 35 | } |
|
| 36 | ||
| 37 | private function makeConfig(Injector $injector, string $config): InjectorConfig |
|
| 38 | { |
|