We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b6ec7d4 + 6e3d608 commit 2a876d6Copy full SHA for 2a876d6
1 file changed
src/routing/PhpRouteHandler.php
@@ -10,7 +10,7 @@ class PhpRouteHandler
10
{
11
private ?ContainerBuilder $container;
12
13
- public function __invoke(Request $request): Response|array
+ public function __invoke(Request $request): Response
14
15
$this->container = $request->attributes->get('_container');
16
$path = $request->attributes->get('_path');
@@ -25,8 +25,8 @@ public function __invoke(Request $request): Response|array
25
26
$response = require $path;
27
28
- if (!$response instanceof Response && !is_array($response)) {
29
- 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);
30
}
31
32
return $response;
0 commit comments