Skip to content

Commit 0ad4b00

Browse files
committed
Fixed bug for routerService dispatch
1 parent 83f573a commit 0ad4b00

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Framework/Router/RouterService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,18 +189,19 @@ public function dispatch($container)
189189
if (isset($parameters[$paramName])) {
190190
$args[$paramName] = $parameters[$paramName];
191191
}
192+
192193
if (!empty($arg->getClass()) && $arg->getClass()->getName() == (ServerRequestInterface::class)) {
193194
$container['psr7Factory'] = new DiactorosFactory();
194195
$container['httpFoundationFactory'] = new HttpFoundationFactory();
195196
$container['Request'] = RequestAdapter::convertPsr7Request(Request::createFromGlobals());
196197
$args[$paramName] = $container['Request'];
197198
}
198199

199-
if (!empty($arg->getClass()) && $arg->getClass()->getName() == (Request::class || \Symfony\Component\HttpFoundation\Request::class)) {
200+
if (!empty($arg->getClass()) && (($arg->getClass()->getName() == Request::class)
201+
|| ($arg->getClass()->getName() == \Symfony\Component\HttpFoundation\Request::class))) {
200202
$args[$paramName] = $container['symfonyRequest'];
201203
}
202204
}
203-
204205
return $method->invokeArgs($instance, $args);
205206
}
206207
}

0 commit comments

Comments
 (0)