Skip to content

Commit

Permalink
compatibility with nette/php-generator v2.6 [Closes #150]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 17, 2017
1 parent aa72c5c commit 06c96ce
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/DI/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 06c96ce

Please sign in to comment.