mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-15 18:23:26 +03:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user