Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a8fb938

Browse files
committed
1 parent a3f28fe commit a8fb938

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Application/MicroPresenter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ public function run(Application\Request $request): Application\IResponse
7676

7777
$params = $request->getParameters();
7878
$callback = $params['callback'] ?? null;
79-
if (!$callback instanceof \Closure) {
79+
if (!is_object($callback) || !is_callable($callback)) {
8080
throw new Application\BadRequestException('Parameter callback is not a valid closure.');
8181
}
82-
$reflection = new \ReflectionFunction($callback);
82+
$reflection = Nette\Utils\Callback::toReflection($callback);
8383

8484
if ($this->context) {
8585
foreach ($reflection->getParameters() as $param) {

0 commit comments

Comments
 (0)