Skip to content

Commit

Permalink
compatibility with nette/php-generator 3.x [Closes #182]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 30, 2019
1 parent 5b1d430 commit d0561b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -18,7 +18,7 @@
"php": ">=5.6.0",
"ext-tokenizer": "*",
"nette/neon": "^2.3.3 || ~3.0.0",
"nette/php-generator": "^2.6.1 || ~3.0.0",
"nette/php-generator": "^2.6.1 || ^3.0.0",
"nette/utils": "^2.5.0 || ~3.0.0"
},
"require-dev": {
Expand Down
3 changes: 2 additions & 1 deletion src/DI/PhpGenerator.php
Expand Up @@ -263,7 +263,8 @@ private function convertParameters(array $parameters)
$tmp = explode(' ', is_int($k) ? $v : $k);
$param = $res[] = new Nette\PhpGenerator\Parameter(end($tmp));
if (!is_int($k)) {
$param->setOptional(true)->setDefaultValue($v);
@$param->setOptional(true); // @ deprecated in nette/php-generator 3.1
$param->setDefaultValue($v);
}
if (isset($tmp[1])) {
$param->setTypeHint($tmp[0]);
Expand Down

0 comments on commit d0561b8

Please sign in to comment.