MediaWiki  1.30.0
PPNode_Hash_Tree Class Reference
Inheritance diagram for PPNode_Hash_Tree:
Collaboration diagram for PPNode_Hash_Tree:

Public Member Functions

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

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. More...
 
static splitRawArg (array $children)
 Like splitArg() but for a raw child array. More...
 
static splitRawExt (array $children)
 Like splitExt() but for a raw child array. More...
 
static splitRawHeading (array $children)
 Like splitHeading() but for a raw child array. More...
 
static splitRawTemplate (array $children)
 Like splitTemplate() but for a raw child array. More...
 

Public Attributes

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

Private Attributes

 $index
 The index into $this->store which contains the descriptor of this node. More...
 
 $rawChildren
 The store array for children of this node. More...
 
 $store
 The store array for the siblings of this node, including this node itself. More...
 

Detailed Description

Definition at line 1679 of file Preprocessor_Hash.php.

Constructor & Destructor Documentation

◆ __construct()

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 1720 of file Preprocessor_Hash.php.

References list, name, and store.

Member Function Documentation

◆ __toString()

PPNode_Hash_Tree::__toString ( )

Convert a node to XML, for debugging.

Definition at line 1757 of file Preprocessor_Hash.php.

References $attribs.

◆ factory()

static 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

Definition at line 1734 of file Preprocessor_Hash.php.

Referenced by PPNode_Hash_Text\getNextSibling(), and PPNode_Hash_Attr\getNextSibling().

◆ getChildren()

PPNode_Hash_Tree::getChildren ( )
Returns
PPNode_Hash_Array

Implements PPNode.

Definition at line 1777 of file Preprocessor_Hash.php.

References as.

◆ getChildrenOfType()

PPNode_Hash_Tree::getChildrenOfType (   $name)

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

Parameters
string$name
Returns
PPNode_Hash_Array

Implements PPNode.

Definition at line 1817 of file Preprocessor_Hash.php.

References $name, and as.

◆ getFirstChild()

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|bool

Implements PPNode.

Definition at line 1792 of file Preprocessor_Hash.php.

◆ getLength()

PPNode_Hash_Tree::getLength ( )
Returns
bool

Implements PPNode.

Definition at line 1838 of file Preprocessor_Hash.php.

◆ getName()

PPNode_Hash_Tree::getName ( )
Returns
string

Implements PPNode.

Definition at line 1853 of file Preprocessor_Hash.php.

References $name.

◆ getNextSibling()

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|bool

Implements PPNode.

Definition at line 1807 of file Preprocessor_Hash.php.

References store.

◆ getRawChildren()

PPNode_Hash_Tree::getRawChildren ( )

Get the raw child array.

For internal use.

Returns
array

Definition at line 1831 of file Preprocessor_Hash.php.

◆ item()

PPNode_Hash_Tree::item (   $i)
Parameters
int$i
Returns
bool

Implements PPNode.

Definition at line 1846 of file Preprocessor_Hash.php.

◆ splitArg()

PPNode_Hash_Tree::splitArg ( )

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

Exceptions
MWException
Returns
array

Implements PPNode.

Definition at line 1866 of file Preprocessor_Hash.php.

◆ splitExt()

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.

Exceptions
MWException
Returns
array

Implements PPNode.

Definition at line 1909 of file Preprocessor_Hash.php.

◆ splitHeading()

PPNode_Hash_Tree::splitHeading ( )

Split an "<h>" node.

Exceptions
MWException
Returns
array

Implements PPNode.

Definition at line 1951 of file Preprocessor_Hash.php.

References name.

◆ splitRawArg()

static 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 1875 of file Preprocessor_Hash.php.

References as.

◆ splitRawExt()

static 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 1918 of file Preprocessor_Hash.php.

References as.

◆ splitRawHeading()

static 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 1963 of file Preprocessor_Hash.php.

References as.

◆ splitRawTemplate()

static 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 1996 of file Preprocessor_Hash.php.

References as.

◆ splitTemplate()

PPNode_Hash_Tree::splitTemplate ( )

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

Exceptions
MWException
Returns
array

Definition at line 1987 of file Preprocessor_Hash.php.

Member Data Documentation

◆ $index

PPNode_Hash_Tree::$index
private

The index into $this->store which contains the descriptor of this node.

Definition at line 1699 of file Preprocessor_Hash.php.

◆ $name

PPNode_Hash_Tree::$name

Definition at line 1682 of file Preprocessor_Hash.php.

◆ $rawChildren

PPNode_Hash_Tree::$rawChildren
private

The store array for children of this node.

It is "raw" in the sense that nodes are two-element arrays ("descriptors") rather than PPNode_Hash_* objects.

Definition at line 1689 of file Preprocessor_Hash.php.

◆ $store

PPNode_Hash_Tree::$store
private

The store array for the siblings of this node, including this node itself.

Definition at line 1694 of file Preprocessor_Hash.php.

◆ CHILDREN

const PPNode_Hash_Tree::CHILDREN = 1

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

Definition at line 1711 of file Preprocessor_Hash.php.

Referenced by PPNode_Hash_Attr\__construct().

◆ NAME

const PPNode_Hash_Tree::NAME = 0

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

Definition at line 1705 of file Preprocessor_Hash.php.

Referenced by PPNode_Hash_Attr\__construct().


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