MediaWiki fundraising/REL1_35
PPCustomFrame_Hash.php
Go to the documentation of this file.
1<?php
26// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
28
29 public $args;
30
31 public function __construct( $preprocessor, $args ) {
32 parent::__construct( $preprocessor );
33 $this->args = $args;
34 }
35
36 public function __toString() {
37 $s = 'cstmframe{';
38 $first = true;
39 foreach ( $this->args as $name => $value ) {
40 if ( $first ) {
41 $first = false;
42 } else {
43 $s .= ', ';
44 }
45 $s .= "\"$name\":\"" .
46 str_replace( '"', '\\"', $value->__toString() ) . '"';
47 }
48 $s .= '}';
49 return $s;
50 }
51
55 public function isEmpty() {
56 return !count( $this->args );
57 }
58
63 public function getArgument( $index ) {
64 return $this->args[$index] ?? false;
65 }
66
67 public function getArguments() {
68 return $this->args;
69 }
70}
Expansion frame with custom arguments.
__construct( $preprocessor, $args)
An expansion frame, used as a context to expand the result of preprocessToObj()
Preprocessor $preprocessor