mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-15 18:23:26 +03:00
Merge pull request #652 from skipperbent/fix-tostring
[BUGFIX] String return type
This commit is contained in:
@@ -27,11 +27,11 @@ class ClassLoader implements IClassLoader
|
||||
* @param object $class
|
||||
* @param string $method
|
||||
* @param array $parameters
|
||||
* @return mixed
|
||||
* @return string
|
||||
*/
|
||||
public function loadClassMethod($class, string $method, array $parameters)
|
||||
public function loadClassMethod($class, string $method, array $parameters): string
|
||||
{
|
||||
return call_user_func_array([$class, $method], array_values($parameters));
|
||||
return (string)call_user_func_array([$class, $method], array_values($parameters));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,11 +39,11 @@ class ClassLoader implements IClassLoader
|
||||
*
|
||||
* @param Callable $closure
|
||||
* @param array $parameters
|
||||
* @return mixed
|
||||
* @return string
|
||||
*/
|
||||
public function loadClosure(Callable $closure, array $parameters)
|
||||
public function loadClosure(callable $closure, array $parameters): string
|
||||
{
|
||||
return call_user_func_array($closure, array_values($parameters));
|
||||
return (string)call_user_func_array($closure, array_values($parameters));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -427,7 +427,7 @@ class Router
|
||||
$routeOutput = $route->renderRoute($this->request, $this);
|
||||
|
||||
if ($this->renderMultipleRoutes === true) {
|
||||
if ($routeOutput !== null) {
|
||||
if ($routeOutput !== '') {
|
||||
return $routeOutput;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user