Skip to content

Commit 14415f9

Browse files
authored
Merge pull request #52 from dakujem/master
Replace `call_user_func_array` with native invocation
2 parents 74f216c + 84ada78 commit 14415f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Invoker.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public function call($callable, array $parameters = [])
5757

5858
$args = $this->parameterResolver->getParameters($callableReflection, $parameters, []);
5959

60-
// Sort by array key because call_user_func_array ignores numeric keys
60+
// Sort by array keys is needed since the resolved arguments returned by the resolver are indexed by numeric keys
61+
// that correspond to the parameters of the callable, but may be out of order.
6162
ksort($args);
6263

6364
// Check all parameters are resolved
@@ -71,7 +72,7 @@ public function call($callable, array $parameters = [])
7172
));
7273
}
7374

74-
return call_user_func_array($callable, $args);
75+
return $callable(...$args);
7576
}
7677

7778
/**

0 commit comments

Comments
 (0)