Merge pull request #449 from jatubio/patch-4

Fix 'must be an instance of Closure, array given' error when $closure is a object method.
This commit is contained in:
Simon Sessingø
2021-03-17 19:12:00 +01:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ class ClassLoader implements IClassLoader
* @return mixed
* @throws NotFoundHttpException
*/
public function loadClosure(\Closure $closure, array $parameters)
public function loadClosure(Callable $closure, array $parameters)
{
if ($this->useDependencyInjection === true) {
$container = $this->getContainer();
@@ -115,4 +115,4 @@ class ClassLoader implements IClassLoader
return $this->useDependencyInjection;
}
}
}

View File

@@ -7,6 +7,6 @@ interface IClassLoader
public function loadClass(string $class);
public function loadClosure(\Closure $closure, array $parameters);
public function loadClosure(Callable $closure, array $parameters);
}
}