diff --git a/src/DI/ContainerBuilder.php b/src/DI/ContainerBuilder.php index 563264bf8..636be84d5 100644 --- a/src/DI/ContainerBuilder.php +++ b/src/DI/ContainerBuilder.php @@ -669,10 +669,9 @@ private function convertParameters(array $parameters) $res = array(); foreach ($parameters as $k => $v) { $tmp = explode(' ', is_int($k) ? $v : $k); - $param = $res[] = new Nette\PhpGenerator\Parameter; - $param->setName(end($tmp)); + $param = $res[] = new Nette\PhpGenerator\Parameter(end($tmp)); if (!is_int($k)) { - $param = $param->setOptional(TRUE)->setDefaultValue($v); + $param->setOptional(TRUE)->setDefaultValue($v); } if (isset($tmp[1])) { $param->setTypeHint($tmp[0]);