Skip to content

Commit

Permalink
Merge pull request #1776 from specialtactics/feature/further-php-8-su…
Browse files Browse the repository at this point in the history
…pport

Further php 8 support
  • Loading branch information
specialtactics authored Apr 30, 2021
2 parents 7c6068e + 1346c2b commit e081cf6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"league/fractal": "^0.19"
},
"require-dev": {
"phpdocumentor/reflection-docblock": "3.3.2",
"friendsofphp/php-cs-fixer": "~2",
"illuminate/auth": "^7.0|^8.0",
"illuminate/cache": "^7.0|^8.0",
Expand Down
9 changes: 8 additions & 1 deletion src/Exception/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,15 @@ protected function handlerHint(callable $callback)
$reflection = new ReflectionFunction($callback);

$exception = $reflection->getParameters()[0];
$reflectionType = $exception->getType();

return $exception->getClass()->getName();
if ($reflectionType && ! $reflectionType->isBuiltin()) {
if ($reflectionType instanceof \ReflectionNamedType) {
return $reflectionType->getName();
}
}

return '';
}

/**
Expand Down

0 comments on commit e081cf6

Please sign in to comment.