TagFactory

Creates tags.

class TagFactory
Copyright
2016 Appertly
License
Apache-2.0

Static Properties

Protected
NameTypeSummary
$constantsImmSet<string>
$notTypesImmSet<string>
$psrKeywordsImmSet<string>
$replaceTypesImmMap<string,string>
$thisyImmSet<string>

Instance Methods

Public
ReturnsSignature and Description
ConstVector<Tag>
convert(?ScannedBase $token, ConstVector<string> $tags)

Creates a bunch of tags

Protected
ReturnsSignature and Description
ParameterTag
doParameterTag(?ScannedBase $token, array<string> $matches)
void
doTag(Vector<Tag> $out, ?ScannedBase $token, string $tag)
TypedTag
doTypedTag(?ScannedBase $token, array<string> $matches)
VersionTag
doVersionTag(?ScannedBase $token, array<string> $matches)
ConstVector<ScannedTypehint>
parseTypes(string $hints, ?ScannedBase $token = null)

Tries to convert a string typehint into a Vector.

?ScannedTypehint
stringToTypehint(string $t, ?ScannedBase $token = null)

Tries to convert a string into a Typehint

Property Details

$constants

static protected ImmSet<string> $constants

$notTypes

static protected ImmSet<string> $notTypes

$psrKeywords

static protected ImmSet<string> $psrKeywords

$replaceTypes

static protected ImmMap<string,string> $replaceTypes

$thisy

static protected ImmSet<string> $thisy

Method Details

convert

public function convert(?ScannedBase $token, ConstVector<string> $tags)

Creates a bunch of tags

Parameters
NameTypeDescription
$token?ScannedBase

The scanned token whose doc comment has these tags

$tagsConstVector<string>

The tags to convert

Returns
TypeDescription
ConstVector<Tag>

doParameterTag

protected function doParameterTag(?ScannedBase $token, array<string> $matches)
Parameters
NameTypeDescription
$token?ScannedBase
$matchesarray<string>
Returns
TypeDescription
ParameterTag

doTag

protected function doTag(Vector<Tag> $out, ?ScannedBase $token, string $tag)
Parameters
NameTypeDescription
$outVector<Tag>
$token?ScannedBase
$tagstring

doTypedTag

protected function doTypedTag(?ScannedBase $token, array<string> $matches)
Parameters
NameTypeDescription
$token?ScannedBase
$matchesarray<string>
Returns
TypeDescription
TypedTag

doVersionTag

protected function doVersionTag(?ScannedBase $token, array<string> $matches)
Parameters
NameTypeDescription
$token?ScannedBase
$matchesarray<string>
Returns
TypeDescription
VersionTag

parseTypes

protected function parseTypes(string $hints, ?ScannedBase $token = null)

Tries to convert a string typehint into a Vector.

parseTypes('Foo|string|null');
Parameters
NameTypeDescription
$hintsstring

The hints to parse

$token?ScannedBase
Returns
TypeDescription
ConstVector<ScannedTypehint>

The typehints contained

stringToTypehint

protected function stringToTypehint(string $t, ?ScannedBase $token = null)

Tries to convert a string into a Typehint

Parameters
NameTypeDescription
$tstring

The string typehint

$token?ScannedBase
Returns
TypeDescription
?ScannedTypehint

The scanned typehint or null