Skip to content

Commit 3e0822c

Browse files
authored
Merge pull request #7 from Bit-Apps-Pro/Bugfix/route-register-issue
fix: call to a member function getName() on null
2 parents 2bf8c32 + c318101 commit 3e0822c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Router/RouteRegister.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function getParamValue(ReflectionParameter $param)
253253
$constructor = new ReflectionMethod($type, '__construct');
254254
if ($constructor->getNumberOfParameters() === 1) {
255255
$parameter = $constructor->getParameters()[0];
256-
if ($parameter->getType()->getName() != 'array') {
256+
if (!$parameter->hasType()) {
257257
$value = new $type($value);
258258
} elseif (method_exists($type, 'query')) {
259259
$value = $type::query()->find($value);

0 commit comments

Comments
 (0)