ResolveInlineLinkAndSeeTags

in package
Implements CompilerPassInterface

This step in the compilation process iterates through all elements and scans their descriptions for an inline `@see` or `@link` tag and resolves them to a markdown link.

Interfaces, Classes & Used Traits

CompilerPassInterface
Represents a single pass / business rule to be executed by the Compiler.

Constants

Properties

private$router  : \phpDocumentor\Transformer\Router\Router                

private$descriptor  : \phpDocumentor\Descriptor\DescriptorAbstract                

private$elementCollection  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\DescriptorAbstract>                

private$descriptorRepository  : \phpDocumentor\Compiler\Linker\DescriptorRepository                

private$tagFactory  : \phpDocumentor\Reflection\DocBlock\TagFactory                

Methods

Registers the router with this pass.

public__construct(Router $router, DescriptorRepository $descriptorRepository, TagFactory $tagFactory) : mixed

Parameters

$router : Router
$descriptorRepository : DescriptorRepository
$tagFactory : TagFactory

Returns

mixed

Returns a textual description of what this pass does for output purposes.

publicgetDescription() : string

Please note that the command line will be truncated to 68 characters ( .. 000.000s) so longer descriptions won't have much use.

Returns

string

Iterates through each element in the project and replaces its inline @see and @link tag with a markdown representation.

publicexecute(ProjectDescriptor $project) : void

This method will execute the business logic associated with a given compiler pass and allow it to manipulate or consumer the Object Graph using the ProjectDescriptor object.

Parameters

$project : ProjectDescriptor

Representation of the Object Graph that can be manipulated.

Resolves all @see and @link tags in the description of the given descriptor to their markdown representation.

privateresolveSeeAndLinkTags(DescriptorAbstract $descriptor) : void

Parameters

$descriptor : DescriptorAbstract
uses
self::resolveTag()

Resolves an individual tag, indicated by the results of the Regex used to extract tags.

privateresolveTag(string[] $match) : string|string[]

Parameters

$match : string[]

Returns

string|string[]

Determines if the given link string represents a URL by checking if it is prefixed with a URI scheme.

privateisUrl(string $link) : bool

Parameters

$link : string

Returns

bool

Creates a Tag Reflector from the given array of tag line, tag name and tag content.

privatecreateLinkOrSeeTagFromRegexMatch(string[] $match) : Tag

Parameters

$match : string[]

Returns

Tag

Generates a Markdown link to the given Descriptor or returns the link text if no route to the Descriptor could be matched.

privateresolveElement(DescriptorAbstract $element, string $link[, string|null $description = null ]) : string

Parameters

$element : DescriptorAbstract
$link : string
$description : string|null = null

Returns

string

Returns the link for the given reflector.

privategetLinkText(Tag $tagReflector) : string|null

Because the link tag and the see tag have different methods to acquire the link text we abstract that into this method.

Parameters

$tagReflector : Tag

Returns

string|null

Creates a DocBlock context containing the namespace and aliases for the current descriptor.

privatecreateDocBlockContext() : Context

Returns

Context