Definition for all Doctrine tags to explode them into subcomponents so they can be better processed in the transformation.

The Doctrine tags follow a deviating syntax from default PHPDoc which is described using the following EBNF: Annotation ::= "@" AnnotationName ["(" [Values] ")"] AnnotationName ::= QualifiedName | SimpleName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName NameSpacePart ::= identifier SimpleName ::= identifier | null | false | true Values ::= Array | Value {"," Value}* Value ::= PlainValue | FieldAssignment PlainValue ::= integer|string|float|boolean|Array|Annotation FieldAssignment ::= FieldName "=" PlainValue FieldName ::= identifier Array ::= "{" ArrayEntry {"," ArrayEntry}* "}" ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key "=" PlainValue Key ::= string | integer This means that a Doctrine Tag may have the following forms: * @Column(type="string", length=32, unique=true, nullable=false) or * @DiscriminatorMap({"person" = "Person", "employee" = "Employee"}) but also the FQCN notation: * @MyCompany\Annotations\Foo An important note is that the opening ( of the parameter list and the Annotation name do not have any whitespace.

category phpDocumentor
package Parser
subpackage Tag_Definitions
author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Initializes this object with the given data and sets the name and description.

__construct(string $namespace, \string[] $namespace_aliases, SimpleXMLElement $xml, \phpDocumentor\Reflection\DocBlock\Tag $tag) 
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::__construct()

Parameters

$namespace

string

Namespace where this tag occurs.

$namespace_aliases

\string[]

Aliases used for all namespaces at the location of this tag.

$xml

\SimpleXMLElement

XML to enhance.

Creates a new instance of this class or one of the specialized sub-classes.

create(string $namespace, \string[] $namespace_aliases, SimpleXMLElement $xml, \phpDocumentor\Reflection\DocBlock\Tag $tag) : \phpDocumentor_Parser_DocBlock_Tag_Definition
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::create()

Parameters

$namespace

string

Namespace where this tag occurs.

$namespace_aliases

\string[]

Aliases used for all namespaces at the location of this tag.

$xml

\SimpleXMLElement

Root xml element for this tag.

$tag

\phpDocumentor\Reflection\DocBlock\Tag

The actual tag as reflected.

Returns

\phpDocumentor_Parser_DocBlock_Tag_Definition

Dispatches a logging request to log a debug message.

debug(string $message) : void
Inherited

inherited_from \phpDocumentor_Parser_Abstract::debug()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::debug()

Parameters

$message

string

The message to log.

Dispatches an event to the Event Dispatcher.

dispatch(string $name, \string[] $arguments) : mixed | null
Inherited

This method tries to dispatch an event; if no Event Dispatcher has been set than this method will explicitly not fail and return null. By not failing we make the Event Dispatcher optional and is it easier for people to re-use this component in their own application.

inherited_from \phpDocumentor_Parser_Abstract::dispatch()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::dispatch()

Parameters

$name

string

Name of the event to dispatch.

$arguments

\string[]

Arguments for this event.

Exceptions

\phpDocumentor_Parser_Exception if there is a dispatcher but it is not of type sfEventDispatcher

Returns

mixednull

Returns the namespace identifier for this tag.

getNamespace() : string
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::getNamespace()

Returns

string

Returns all aliases for namespaces at the location of this tag.

getNamespaceAliases() : array
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::getNamespaceAliases()

Returns

array

Dispatches a logging request.

log(string $message, int $priority) : void
Inherited

inherited_from \phpDocumentor_Parser_Abstract::log()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::log()

Parameters

$message

string

The message to log.

$priority

int

The logging priority, the lower, the more important. Ranges from 1 to 7

Setter for the description so it can be overridden.

setDescription(string $description) : void
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::setDescription()

Parameters

$description

string

Description for this definition.

Setter for the name so it can be overridden.

setName(string $name) : void
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::setName()

Parameters

$name

string

Name for this definition.

Sets the namespace for this tag; is used to determine type info.

setNamespace(string $namespace) : void
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::setNamespace()

Parameters

$namespace

string

Namespace name for this definition.

Sets the aliases for all namespaces.

setNamespaceAliases(\string[] $namespace_aliases) : void
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::setNamespaceAliases()

Parameters

$namespace_aliases

\string[]

Array of aliases.

Setter for the reference so it can be overridden.

setReference(string $name) : void
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::setReference()

Parameters

$name

string

Name of the element to which is referred.

Adds type information to the structure.

setTypes(\string[] $types) : void
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::setTypes()

Parameters

$types

\string[]

Array with types in any format; will be transformed to FQCN.

Adds a new attribute `refers` to the structure element for this tag and set the description to the element name.

configure() : void

Tries to expand a type to it's full namespaced equivalent.

expandType(string $type, bool $ignore_non_objects) : string
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::expandType()

Parameters

$type

string

Type to expand into full namespaced equivalent.

$ignore_non_objects

bool

whether to ignore reserved words, when false it will not expand a set of keywords.

Returns

string

Search for the Arguments and return them as arrays with a FieldName and Value.

findArguments(string $description) : \array[]

See the EBFN in the class' documentation for the business rules used to split the Annotation's arguments.

Parameters

$description

string

The arguments string to parse.

Returns

\array[]

 Properties

 

The event dispatcher object, may be null to not dispatch events.

$event_dispatcher : \sfEventDispatcher | null
Inherited

inherited_from \phpDocumentor_Parser_Abstract::$$event_dispatcher
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::$$event_dispatcher
 

$namespace

$namespace : string
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::$$namespace
 

$namespace_aliases

$namespace_aliases : array
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::$$namespace_aliases
 

$tag

$tag : \phpDocumentor\Reflection\DocBlock\Tag
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::$$tag
 

$xml

$xml : \SimpleXMLElement
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Tag_Definition::$$xml