From 65a85616f432c3511991b787b7e5ec10ae2eb79c Mon Sep 17 00:00:00 2001 From: Martin Rademacher Date: Thu, 2 Jul 2020 14:22:53 +1200 Subject: [PATCH] Use ReflectionParameter::getType() instead of getClass() `iReflectionParameter::getClass()` is deprecated as of PHP 8 and will trigger a warning. --- src/DocBlock/StandardTagFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DocBlock/StandardTagFactory.php b/src/DocBlock/StandardTagFactory.php index 8fb4aca..8e412fe 100644 --- a/src/DocBlock/StandardTagFactory.php +++ b/src/DocBlock/StandardTagFactory.php @@ -254,10 +254,10 @@ final class StandardTagFactory implements TagFactory { $arguments = []; foreach ($parameters as $parameter) { - $class = $parameter->getClass(); + $type = $parameter->getType(); $typeHint = null; - if ($class !== null) { - $typeHint = $class->getName(); + if ($type instanceof \ReflectionNamedType) { + $typeHint = $type->getName(); } if (isset($locator[$typeHint])) {