Skip to content

Commit

Permalink
FunctionLike: accept numeric array keys in setParameters [Closes #91]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 1, 2021
1 parent bce6abc commit 15a3490
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpGenerator/Traits/FunctionLike.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function addBody(string $code, array $args = null): self
*/
public function setParameters(array $val): self
{
(function (Parameter ...$val) {})(...$val);
(function (Parameter ...$val) {})(...array_values($val));
$this->parameters = [];
foreach ($val as $v) {
$this->parameters[$v->getName()] = $v;
Expand Down

0 comments on commit 15a3490

Please sign in to comment.