phpDocumentor

Dummy extends Directive in package Default

A directive is like a function you can call or apply to a block Il looks like:

.. function:: main :arg1: value :arg2: otherValue

Some block !

The directive can define variables, create special nodes or change the node that directly follows it

finalize()  : void
Called at the end of the parsing to finalize the document (add something or tweak nodes)
getName()  : string
Get the directive name
process()  : void
This is the function called by the parser to process the directive, it can be overloaded to do anything with the document, like tweaking nodes or change the environment
processAction()  : void
This can be overloaded to write a directive that just do an action without changing the nodes of the document
processNode()  : Node|null
This can be overloaded to write a directive that just create one node for the document, which is common
wantCode()  : bool
Should the following block be passed as a CodeNode?

Methods

finalize()

Called at the end of the parsing to finalize the document (add something or tweak nodes)

``` public finalize(DocumentNode \$document) : void```
Parameters
\$document : DocumentNode
void

getName()

Get the directive name

``` public getName() : string```
string

process()

This is the function called by the parser to process the directive, it can be overloaded to do anything with the document, like tweaking nodes or change the environment

``` public process(Parser \$parser, Node|null \$node, string \$variable, string \$data, array<string|int, string> \$options) : void```

The node that directly follows the directive is also passed to it

Parameters
\$parser : Parser

the calling parser

\$node : Node|null

the node that follows the directive

\$variable : string

the variable name of the directive

\$data : string

the data of the directive (following ::)

\$options : array<string|int, string>

the array of options for this directive

void

processAction()

This can be overloaded to write a directive that just do an action without changing the nodes of the document

``` public processAction(Parser \$parser, string \$variable, string \$data, array<string|int, string> \$options) : void```

The arguments are the same that process

Parameters
\$parser : Parser
\$variable : string
\$data : string
\$options : array<string|int, string>
void

processNode()

This can be overloaded to write a directive that just create one node for the document, which is common

``` public processNode(Parser \$parser, string \$variable, string \$data, array<string|int, string> \$options) : Node|null```
Parameters
\$parser : Parser
\$variable : string
\$data : string
\$options : array<string|int, string>
Node|null

wantCode()

Should the following block be passed as a CodeNode?

``` public wantCode() : bool```
bool