mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Merge pull request #240 from DerManoMann/reflectionparameter-getclass-deprecated-php8
Use ReflectionParameter::getType() instead of getClass()
This commit is contained in:
@@ -36,6 +36,7 @@ use phpDocumentor\Reflection\DocBlock\Tags\Version;
|
||||
use phpDocumentor\Reflection\FqsenResolver;
|
||||
use phpDocumentor\Reflection\Types\Context as TypeContext;
|
||||
use ReflectionMethod;
|
||||
use ReflectionNamedType;
|
||||
use ReflectionParameter;
|
||||
use Webmozart\Assert\Assert;
|
||||
use function array_merge;
|
||||
@@ -254,10 +255,16 @@ 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 ($typeHint === 'self') {
|
||||
$declaringClass = $parameter->getDeclaringClass();
|
||||
if ($declaringClass !== null) {
|
||||
$typeHint = $declaringClass->getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($locator[$typeHint])) {
|
||||
|
||||
Reference in New Issue
Block a user