MediaWiki
master
PPCustomFrame_Hash.php
Go to the documentation of this file.
1
<?php
8
namespace
MediaWiki\Parser
;
9
14
// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
15
class
PPCustomFrame_Hash
extends
PPFrame_Hash
{
16
18
public
$args
;
19
24
public
function
__construct
(
$preprocessor
,
$args
) {
25
parent::__construct(
$preprocessor
);
26
$this->args =
$args
;
27
}
28
29
public
function
__toString
() {
30
$s =
'cstmframe{'
;
31
$first =
true
;
32
foreach
( $this->args as $name => $value ) {
33
if
( $first ) {
34
$first =
false
;
35
}
else
{
36
$s .=
', '
;
37
}
38
$s .=
"\"$name\":\""
.
39
str_replace(
'"'
,
'\\"'
, $value->__toString() ) .
'"'
;
40
}
41
$s .=
'}'
;
42
return
$s;
43
}
44
48
public
function
isEmpty
() {
49
return
!count( $this->args );
50
}
51
56
public
function
getArgument
( $index ) {
57
return
$this->args[$index] ??
false
;
58
}
59
61
public
function
getArguments
() {
62
return
$this->args
;
63
}
64
}
65
67
class_alias( PPCustomFrame_Hash::class,
'PPCustomFrame_Hash'
);
MediaWiki\Parser\PPCustomFrame_Hash
Expansion frame with custom arguments.
Definition
PPCustomFrame_Hash.php:15
MediaWiki\Parser\PPCustomFrame_Hash\__construct
__construct( $preprocessor, $args)
Definition
PPCustomFrame_Hash.php:24
MediaWiki\Parser\PPCustomFrame_Hash\$args
array $args
Definition
PPCustomFrame_Hash.php:18
MediaWiki\Parser\PPCustomFrame_Hash\getArgument
getArgument( $index)
Definition
PPCustomFrame_Hash.php:56
MediaWiki\Parser\PPCustomFrame_Hash\getArguments
getArguments()
array
Definition
PPCustomFrame_Hash.php:61
MediaWiki\Parser\PPCustomFrame_Hash\__toString
__toString()
Definition
PPCustomFrame_Hash.php:29
MediaWiki\Parser\PPCustomFrame_Hash\isEmpty
isEmpty()
Definition
PPCustomFrame_Hash.php:48
MediaWiki\Parser\PPFrame_Hash
An expansion frame, used as a context to expand the result of preprocessToObj()
Definition
PPFrame_Hash.php:21
MediaWiki\Parser\PPFrame_Hash\$preprocessor
Preprocessor $preprocessor
Definition
PPFrame_Hash.php:31
MediaWiki\Parser
Definition
BlockLevelPass.php:13
includes
Parser
PPCustomFrame_Hash.php
Generated on Sat Jan 17 2026 22:50:08 for MediaWiki by
1.10.0