mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 19:12:13 +00: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
|
* @return mixed
|
||||||
* @throws NotFoundHttpException
|
* @throws NotFoundHttpException
|
||||||
*/
|
*/
|
||||||
public function loadClosure(\Closure $closure, array $parameters)
|
public function loadClosure(Callable $closure, array $parameters)
|
||||||
{
|
{
|
||||||
if ($this->useDependencyInjection === true) {
|
if ($this->useDependencyInjection === true) {
|
||||||
$container = $this->getContainer();
|
$container = $this->getContainer();
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ interface IClassLoader
|
|||||||
|
|
||||||
public function loadClass(string $class);
|
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