MediaWiki  master
PPCustomFrame_Hash.php
Go to the documentation of this file.
1 <?php
26 // phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
28 
30  public $args;
31 
36  public function __construct( $preprocessor, $args ) {
37  parent::__construct( $preprocessor );
38  $this->args = $args;
39  }
40 
41  public function __toString() {
42  $s = 'cstmframe{';
43  $first = true;
44  foreach ( $this->args as $name => $value ) {
45  if ( $first ) {
46  $first = false;
47  } else {
48  $s .= ', ';
49  }
50  $s .= "\"$name\":\"" .
51  str_replace( '"', '\\"', $value->__toString() ) . '"';
52  }
53  $s .= '}';
54  return $s;
55  }
56 
60  public function isEmpty() {
61  return !count( $this->args );
62  }
63 
68  public function getArgument( $index ) {
69  return $this->args[$index] ?? false;
70  }
71 
72  public function getArguments() {
73  return $this->args;
74  }
75 }
PPCustomFrame_Hash\__toString
__toString()
Definition: PPCustomFrame_Hash.php:41
PPFrame_Hash
An expansion frame, used as a context to expand the result of preprocessToObj()
Definition: PPFrame_Hash.php:27
PPCustomFrame_Hash\isEmpty
isEmpty()
Definition: PPCustomFrame_Hash.php:60
PPCustomFrame_Hash\$args
array $args
Definition: PPCustomFrame_Hash.php:30
PPCustomFrame_Hash\__construct
__construct( $preprocessor, $args)
Definition: PPCustomFrame_Hash.php:36
$s
foreach( $mmfl['setupFiles'] as $fileName) if( $queue) if(empty( $mmfl['quiet'])) $s
Definition: mergeMessageFileList.php:206
PPFrame_Hash\$preprocessor
Preprocessor $preprocessor
Definition: PPFrame_Hash.php:37
PPCustomFrame_Hash\getArgument
getArgument( $index)
Definition: PPCustomFrame_Hash.php:68
PPCustomFrame_Hash\getArguments
getArguments()
Definition: PPCustomFrame_Hash.php:72
PPCustomFrame_Hash
Expansion frame with custom arguments.
Definition: PPCustomFrame_Hash.php:27