Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/routing/PhpRouteHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PhpRouteHandler
{
private ?ContainerBuilder $container;

public function __invoke(Request $request): Response|array
public function __invoke(Request $request): Response
{
$this->container = $request->attributes->get('_container');
$path = $request->attributes->get('_path');
Expand All @@ -25,8 +25,8 @@ public function __invoke(Request $request): Response|array

$response = require $path;

if (!$response instanceof Response && !is_array($response)) {
throw new \Exception('PHP file must return a response object or an array: ' . $path);
if (!$response instanceof Response) {
throw new \Exception('PHP file must return a response object: ' . $path);
}

return $response;
Expand Down
Loading