diff --git a/src/SegmentRouter.php b/src/SegmentRouter.php index f9e8ec9..69651d8 100644 --- a/src/SegmentRouter.php +++ b/src/SegmentRouter.php @@ -72,13 +72,13 @@ class SegmentRouter implements RouterInterface } // if we can't find a node for this segment, return 404 - return ['code' => 404, 'handler' => null, 'params' => null]; + return ['code' => 404, 'handler' => null, 'params' => []]; } // if we found a handler for the method, return it and any params. if not, return a 405 return isset($node[$method]) - ? ['code' => 200, 'handler' => $node[$method], 'params' => $params ?? null] - : ['code' => 405, 'handler' => null, 'params' => null]; + ? ['code' => 200, 'handler' => $node[$method], 'params' => $params ?? []] + : ['code' => 405, 'handler' => null, 'params' => []]; } /**