Skip to content

ReferenceResolver

Rewrites the references in docblock prose into a form an emitter can link.

The framework writes these unqualified — Context, [ReferenceResolver::reset()](/api/docs/docblock/reference-resolver/#reset) — which only the declaring file’s imports can resolve, so it has to happen here rather than at render time. Left alone they reach the page verbatim, braces and all, which is how a reference ends up looking abandoned.

Output is Name::member when the target resolved and plain backticked text when it did not, so the emitter never has to guess.

final class ReferenceResolver

SourceDocblock/ReferenceResolver.php
MethodDescription
resolve(DocBlock $doc, ScannedType $context): DocBlockResolves every reference in a docblock’s prose against the file that declared it.

public function resolve(DocBlock $doc, ScannedType $context): DocBlock

Resolves every reference in a docblock’s prose against the file that declared it.

ParameterTypeDescription
$docDocBlock
$contextScannedType

Returns DocBlock