Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/DocBlock/StandardTagFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
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;
Expand Down Expand Up @@ -254,10 +255,16 @@ private function getArgumentsForParametersFromWiring(array $parameters, array $l
{
$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])) {
Expand Down