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