From 1b7759a3ba20cd7113752e3ba2463a535220dd5b Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Thu, 7 Dec 2017 14:48:31 +0100 Subject: [PATCH] avoid error during error reporting in chain router the UrlGeneratorInterface::generate is not very specific about $parameters and allows non-arrays. simple solution as its only about reporting in an edge case of an error situation. --- src/ChainRouter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ChainRouter.php b/src/ChainRouter.php index 313baa36..1e9548f7 100644 --- a/src/ChainRouter.php +++ b/src/ChainRouter.php @@ -288,6 +288,10 @@ private function rebuildRequest($pathinfo) private function getErrorMessage($name, $router = null, $parameters = null) { if ($router instanceof VersatileGeneratorInterface) { + // the $parameters are not forced to be array, but versatile generator does typehint it + if (!is_array($parameters)) { + $parameters = []; + } $displayName = $router->getRouteDebugMessage($name, $parameters); } elseif (is_object($name)) { $displayName = method_exists($name, '__toString')