Skip to content

Tag reference

@link

The @link tag points from the described element to an external web resource: a specification, an RFC, a blog post explaining a tricky algorithm, or a page in an external vendor’s documentation. Unlike @see, which can reference either a symbol in the codebase or a URI, @link only ever points outside the codebase — its argument must be a well-formed URI, never a class, method, or constant reference.

Grammar

"@link" <URI> [ <Description> ]

Examples

A bare link to an external specification.
/**
* @link https://www.rfc-editor.org/rfc/rfc3986
*/
A link with a description explaining why it's relevant.
/**
* @link https://example.com/docs/rate-limits Applies to all public
* endpoints.
*/

Names by platform

standard
@link

Parsing a @link tag produces a LinkTag instance:

final class LinkTag extends ReferenceTag
{
public function __construct(
string $name,
UriReference $uri,
?DescriptionInterface $description = null,
) {
parent::__construct(
$name,
$uri,
$description,
);
}
}

It exposes $reference — the parsed UriReference — inherited from ReferenceTag, not $uri: that name is only the constructor parameter used before forwarding the value to the parent class.

@link may also be used inline, nested inside a description as a {@link ...} sequence, rather than only on its own line:

/**
* Retries follow the backoff described in
* {@link https://example.com/docs/retries}.
*/

Defined by the PSR-19 draft and phpDocumentor’s own page; the underlying URI syntax follows RFC 3986.