From d324bc02a7f2732a28115ea7cd12ef356d3784cf Mon Sep 17 00:00:00 2001 From: MGatner Date: Fri, 22 Mar 2019 09:27:26 -0400 Subject: [PATCH] Ignore callbacks in routes list The CLI command Routes iterates routes from system & app to display them as a table, but ends up trying to display callbacks. This change ignores any `$to` destinations that aren't strings. --- system/Commands/Utilities/Routes.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/system/Commands/Utilities/Routes.php b/system/Commands/Utilities/Routes.php index f8c8092d24d3..fada6d4971ac 100644 --- a/system/Commands/Utilities/Routes.php +++ b/system/Commands/Utilities/Routes.php @@ -122,11 +122,14 @@ public function run(array $params) foreach ($routes as $from => $to) { - $tbody[] = [ - $from, - $method, - $to, - ]; + // filter for strings, as callbacks aren't displayable + if (is_string($to)) { + $tbody[] = [ + $from, + $method, + $to, + ]; + } } }