Split parser related files to have one class in one file
[lhc/web/wiklou.git] / includes / parser / PPNode_Hash_Array.php
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 * @ingroup Parser
20 */
21
22 /**
23 * @ingroup Parser
24 */
25 // phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
26 class PPNode_Hash_Array implements PPNode {
27
28 public $value;
29
30 public function __construct( $value ) {
31 $this->value = $value;
32 }
33
34 public function __toString() {
35 return var_export( $this, true );
36 }
37
38 public function getLength() {
39 return count( $this->value );
40 }
41
42 public function item( $i ) {
43 return $this->value[$i];
44 }
45
46 public function getName() {
47 return '#nodelist';
48 }
49
50 public function getNextSibling() {
51 return false;
52 }
53
54 public function getChildren() {
55 return false;
56 }
57
58 public function getFirstChild() {
59 return false;
60 }
61
62 public function getChildrenOfType( $name ) {
63 return false;
64 }
65
66 public function splitArg() {
67 throw new MWException( __METHOD__ . ': not supported' );
68 }
69
70 public function splitExt() {
71 throw new MWException( __METHOD__ . ': not supported' );
72 }
73
74 public function splitHeading() {
75 throw new MWException( __METHOD__ . ': not supported' );
76 }
77 }