Skip to content

Commit

Permalink
Update to nikic/php-parser 4.13.1 (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Nov 17, 2021
1 parent 6aa78f9 commit f0b639b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"idiosyncratic/editorconfig": "^0.1.3",
"myclabs/php-enum": "^1.8",
"nette/utils": "^3.2",
"nikic/php-parser": "4.13.0",
"nikic/php-parser": "4.13.1",
"phpstan/phpdoc-parser": "^1.2",
"phpstan/phpstan": "^1.1.1",
"phpstan/phpstan-phpunit": "^1.0",
Expand Down
14 changes: 8 additions & 6 deletions rules/Php74/Rector/Closure/ClosureToArrowFunctionRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ public function refactor(Node $node): ?Node
return null;
}

$arrowFunction = new ArrowFunction();
$arrowFunction->params = $node->params;
$arrowFunction->returnType = $node->returnType;
$arrowFunction->byRef = $node->byRef;

$arrowFunction->expr = $returnExpr;
$arrowFunction = new ArrowFunction(
[
'params' => $node->params,
'returnType' => $node->returnType,
'byRef' => $node->byRef,
'expr' => $returnExpr,
]
);

if ($node->static) {
$arrowFunction->static = true;
Expand Down

0 comments on commit f0b639b

Please sign in to comment.