MediaWiki master
MediaWiki\Parser\PPNode_Hash_Tree Class Reference

Inherits Stringable, and MediaWiki\Parser\PPNode.

Collaboration diagram for MediaWiki\Parser\PPNode_Hash_Tree:

Public Member Functions

 __construct (array $store, $index)
 Construct an object using the data from $store[$index].
 
 __toString ()
 Convert a node to XML, for debugging.
 
 getChildren ()
 
 getChildrenOfType ( $name)
 Get an array of the children with a given node name.
 
 getFirstChild ()
 Get the first child, or false if there is none.
 
 getLength ()
 
 getName ()
 
 getNextSibling ()
 Get the next sibling, or false if there is none.
 
 getRawChildren ()
 Get the raw child array.
 
 item ( $i)
 
 splitArg ()
 Split a "<part>" node into an associative array containing:
 
 splitExt ()
 Split an "<ext>" node into an associative array containing name, attr, inner and close All values in the resulting array are PPNodes.
 
 splitHeading ()
 Split an "<h>" node.
 
 splitTemplate ()
 Split a "<template>" or "<tplarg>" node.
 

Static Public Member Functions

static factory (array $store, $index)
 Construct an appropriate PPNode_Hash_* object with a class that depends on what is at the relevant store index.
 
static splitRawArg (array $children)
 Like splitArg() but for a raw child array.
 
static splitRawExt (array $children)
 Like splitExt() but for a raw child array.
 
static splitRawHeading (array $children)
 Like splitHeading() but for a raw child array.
 
static splitRawTemplate (array $children)
 Like splitTemplate() but for a raw child array.
 

Public Attributes

string $name
 
const CHILDREN = 1
 The offset of the child list within descriptors, used in some places for readability.
 
const NAME = 0
 The offset of the name within descriptors, used in some places for readability.
 

Detailed Description

Definition at line 32 of file PPNode_Hash_Tree.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\PPNode_Hash_Tree::__construct ( array $store,
$index )

Construct an object using the data from $store[$index].

The rest of the store array can be accessed via getNextSibling().

Parameters
array$store
int$index

Definition at line 76 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\$name.

Member Function Documentation

◆ __toString()

MediaWiki\Parser\PPNode_Hash_Tree::__toString ( )

Convert a node to XML, for debugging.

Returns
string

Definition at line 114 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\getFirstChild().

◆ factory()

static MediaWiki\Parser\PPNode_Hash_Tree::factory ( array $store,
$index )
static

Construct an appropriate PPNode_Hash_* object with a class that depends on what is at the relevant store index.

Parameters
array$store
int$index
Returns
PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|false

Definition at line 90 of file PPNode_Hash_Tree.php.

Referenced by MediaWiki\Parser\PPNode_Hash_Tree\getChildren(), MediaWiki\Parser\PPNode_Hash_Tree\getChildrenOfType(), MediaWiki\Parser\PPNode_Hash_Tree\getFirstChild(), MediaWiki\Parser\PPNode_Hash_Attr\getNextSibling(), MediaWiki\Parser\PPNode_Hash_Text\getNextSibling(), and MediaWiki\Parser\PPNode_Hash_Tree\getNextSibling().

◆ getChildren()

MediaWiki\Parser\PPNode_Hash_Tree::getChildren ( )
Returns
PPNode_Hash_Array

Implements MediaWiki\Parser\PPNode.

Definition at line 135 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\factory().

◆ getChildrenOfType()

MediaWiki\Parser\PPNode_Hash_Tree::getChildrenOfType ( $name)

Get an array of the children with a given node name.

Parameters
string$name
Returns
PPNode_Hash_Array

Implements MediaWiki\Parser\PPNode.

Definition at line 175 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\$name, and MediaWiki\Parser\PPNode_Hash_Tree\factory().

◆ getFirstChild()

MediaWiki\Parser\PPNode_Hash_Tree::getFirstChild ( )

Get the first child, or false if there is none.

Note that this will return a temporary proxy object: different instances will be returned if this is called more than once on the same node.

Returns
PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|false

Implements MediaWiki\Parser\PPNode.

Definition at line 150 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\factory().

Referenced by MediaWiki\Parser\PPNode_Hash_Tree\__toString().

◆ getLength()

MediaWiki\Parser\PPNode_Hash_Tree::getLength ( )
Returns
bool

Implements MediaWiki\Parser\PPNode.

Definition at line 196 of file PPNode_Hash_Tree.php.

◆ getName()

MediaWiki\Parser\PPNode_Hash_Tree::getName ( )
Returns
string

Implements MediaWiki\Parser\PPNode.

Definition at line 211 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\$name.

◆ getNextSibling()

MediaWiki\Parser\PPNode_Hash_Tree::getNextSibling ( )

Get the next sibling, or false if there is none.

Note that this will return a temporary proxy object: different instances will be returned if this is called more than once on the same node.

Returns
PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|false

Implements MediaWiki\Parser\PPNode.

Definition at line 165 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\factory().

◆ getRawChildren()

MediaWiki\Parser\PPNode_Hash_Tree::getRawChildren ( )

Get the raw child array.

For internal use.

Returns
array

Definition at line 189 of file PPNode_Hash_Tree.php.

◆ item()

MediaWiki\Parser\PPNode_Hash_Tree::item ( $i)
Parameters
int$i
Returns
bool

Implements MediaWiki\Parser\PPNode.

Definition at line 204 of file PPNode_Hash_Tree.php.

◆ splitArg()

MediaWiki\Parser\PPNode_Hash_Tree::splitArg ( )

Split a "<part>" node into an associative array containing:

  • name PPNode name
  • index String index
  • value PPNode value
Returns
array

Implements MediaWiki\Parser\PPNode.

Definition at line 223 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\splitRawArg().

◆ splitExt()

MediaWiki\Parser\PPNode_Hash_Tree::splitExt ( )

Split an "<ext>" node into an associative array containing name, attr, inner and close All values in the resulting array are PPNodes.

Inner and close are optional.

Returns
array

Implements MediaWiki\Parser\PPNode.

Definition at line 265 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\splitRawExt().

◆ splitHeading()

MediaWiki\Parser\PPNode_Hash_Tree::splitHeading ( )

Split an "<h>" node.

Returns
array

Implements MediaWiki\Parser\PPNode.

Definition at line 306 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\splitRawHeading().

◆ splitRawArg()

static MediaWiki\Parser\PPNode_Hash_Tree::splitRawArg ( array $children)
static

Like splitArg() but for a raw child array.

For internal use only.

Parameters
array$children
Returns
array

Definition at line 232 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\CHILDREN, and MediaWiki\Parser\PPNode_Hash_Tree\NAME.

Referenced by MediaWiki\Parser\PPNode_Hash_Tree\splitArg().

◆ splitRawExt()

static MediaWiki\Parser\PPNode_Hash_Tree::splitRawExt ( array $children)
static

Like splitExt() but for a raw child array.

For internal use only.

Parameters
array$children
Returns
array

Definition at line 274 of file PPNode_Hash_Tree.php.

Referenced by MediaWiki\Parser\PPFrame_Hash\expand(), and MediaWiki\Parser\PPNode_Hash_Tree\splitExt().

◆ splitRawHeading()

static MediaWiki\Parser\PPNode_Hash_Tree::splitRawHeading ( array $children)
static

Like splitHeading() but for a raw child array.

For internal use only.

Parameters
array$children
Returns
array

Definition at line 318 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\CHILDREN.

Referenced by MediaWiki\Parser\PPFrame_Hash\expand(), and MediaWiki\Parser\PPNode_Hash_Tree\splitHeading().

◆ splitRawTemplate()

static MediaWiki\Parser\PPNode_Hash_Tree::splitRawTemplate ( array $children)
static

Like splitTemplate() but for a raw child array.

For internal use only.

Parameters
array$children
Returns
array

Definition at line 351 of file PPNode_Hash_Tree.php.

Referenced by MediaWiki\Parser\PPFrame_Hash\expand(), and MediaWiki\Parser\PPNode_Hash_Tree\splitTemplate().

◆ splitTemplate()

MediaWiki\Parser\PPNode_Hash_Tree::splitTemplate ( )

Split a "<template>" or "<tplarg>" node.

Returns
array

Definition at line 341 of file PPNode_Hash_Tree.php.

References MediaWiki\Parser\PPNode_Hash_Tree\splitRawTemplate().

Member Data Documentation

◆ $name

◆ CHILDREN

const MediaWiki\Parser\PPNode_Hash_Tree::CHILDREN = 1

The offset of the child list within descriptors, used in some places for readability.

Definition at line 67 of file PPNode_Hash_Tree.php.

Referenced by MediaWiki\Parser\PPNode_Hash_Attr\__construct(), MediaWiki\Parser\PPNode_Hash_Tree\splitRawArg(), and MediaWiki\Parser\PPNode_Hash_Tree\splitRawHeading().

◆ NAME

const MediaWiki\Parser\PPNode_Hash_Tree::NAME = 0

The offset of the name within descriptors, used in some places for readability.

Definition at line 61 of file PPNode_Hash_Tree.php.

Referenced by MediaWiki\Parser\PPNode_Hash_Attr\__construct(), and MediaWiki\Parser\PPNode_Hash_Tree\splitRawArg().


The documentation for this class was generated from the following file: