Skip to content

Commit 3399312

Browse files
committed
Parameters: all parameters are expanded at once
1 parent 95636a7 commit 3399312

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

‎src/DI/Extensions/DefinitionSchema.php‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public function complete($def, Context $context)
4848
}
4949
}
5050

51-
$def = $this->expandParameters($def);
5251
$type = $this->sniffType(end($context->path), $def);
5352
$def = $this->getSchema($type)->complete($def, $context);
5453
if ($def) {
@@ -171,12 +170,6 @@ private function sniffType($key, array $def): string
171170
}
172171

173172

174-
private function expandParameters(array $config): array
175-
{
176-
return Nette\DI\Helpers::expand($config, $this->builder->parameters);
177-
}
178-
179-
180173
private static function getSchema(string $type): Schema
181174
{
182175
static $cache;

‎src/DI/Extensions/ParametersExtension.php‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ public function loadConfiguration(): void
4444
}
4545

4646
$builder->parameters = Helpers::expand($params, $params, recursive: true);
47-
48-
// expand all except 'services'
49-
$slice = array_diff_key($this->compilerConfig, ['services' => 1]);
50-
$slice = Helpers::expand($slice, $builder->parameters);
51-
$this->compilerConfig = $slice + $this->compilerConfig;
47+
$this->compilerConfig = Helpers::expand($this->compilerConfig, $builder->parameters);
5248
}
5349

5450

0 commit comments

Comments
 (0)