MediaWiki  master
PPNode_Hash_Array.php
Go to the documentation of this file.
1 <?php
25 // phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
26 class PPNode_Hash_Array implements PPNode {
27 
29  public $value;
30 
34  public function __construct( $value ) {
35  $this->value = $value;
36  }
37 
38  public function __toString() {
39  return var_export( $this, true );
40  }
41 
42  public function getLength() {
43  return count( $this->value );
44  }
45 
46  public function item( $i ) {
47  return $this->value[$i];
48  }
49 
50  public function getName() {
51  return '#nodelist';
52  }
53 
54  public function getNextSibling() {
55  return false;
56  }
57 
58  public function getChildren() {
59  return false;
60  }
61 
62  public function getFirstChild() {
63  return false;
64  }
65 
66  public function getChildrenOfType( $name ) {
67  return false;
68  }
69 
70  public function splitArg() {
71  // @phan-suppress-previous-line PhanPluginNeverReturnMethod
72  throw new MWException( __METHOD__ . ': not supported' );
73  }
74 
75  public function splitExt() {
76  // @phan-suppress-previous-line PhanPluginNeverReturnMethod
77  throw new MWException( __METHOD__ . ': not supported' );
78  }
79 
80  public function splitHeading() {
81  // @phan-suppress-previous-line PhanPluginNeverReturnMethod
82  throw new MWException( __METHOD__ . ': not supported' );
83  }
84 }
PPNode_Hash_Array\splitHeading
splitHeading()
Split an "<h>" node.
Definition: PPNode_Hash_Array.php:80
PPNode_Hash_Array\$value
array $value
Definition: PPNode_Hash_Array.php:29
PPNode_Hash_Array\splitExt
splitExt()
Split an "<ext>" node into an associative array containing name, attr, inner and close All values in ...
Definition: PPNode_Hash_Array.php:75
PPNode_Hash_Array\splitArg
splitArg()
Split a "<part>" node into an associative array containing: name PPNode name index String index value...
Definition: PPNode_Hash_Array.php:70
PPNode_Hash_Array\getFirstChild
getFirstChild()
Get the first child of a tree node.
Definition: PPNode_Hash_Array.php:62
MWException
MediaWiki exception.
Definition: MWException.php:29
PPNode_Hash_Array\getChildrenOfType
getChildrenOfType( $name)
Get all children of this tree node which have a given name.
Definition: PPNode_Hash_Array.php:66
PPNode_Hash_Array\getLength
getLength()
Returns the length of the array, or false if this is not an array-type node.
Definition: PPNode_Hash_Array.php:42
PPNode
There are three types of nodes:
Definition: PPNode.php:35
PPNode_Hash_Array
Definition: PPNode_Hash_Array.php:26
PPNode_Hash_Array\__construct
__construct( $value)
Definition: PPNode_Hash_Array.php:34
PPNode_Hash_Array\item
item( $i)
Returns an item of an array-type node.
Definition: PPNode_Hash_Array.php:46
PPNode_Hash_Array\getChildren
getChildren()
Get an array-type node containing the children of this node.
Definition: PPNode_Hash_Array.php:58
PPNode_Hash_Array\getName
getName()
Get the name of this node.
Definition: PPNode_Hash_Array.php:50
PPNode_Hash_Array\getNextSibling
getNextSibling()
Get the next sibling of any node.
Definition: PPNode_Hash_Array.php:54
PPNode_Hash_Array\__toString
__toString()
Definition: PPNode_Hash_Array.php:38