MediaWiki
master
PPCustomFrame_Hash.php
Go to the documentation of this file.
1
<?php
22
namespace
MediaWiki\Parser
;
23
28
// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
29
class
PPCustomFrame_Hash
extends
PPFrame_Hash
{
30
32
public
$args
;
33
38
public
function
__construct
(
$preprocessor
,
$args
) {
39
parent::__construct(
$preprocessor
);
40
$this->args =
$args
;
41
}
42
43
public
function
__toString
() {
44
$s =
'cstmframe{'
;
45
$first =
true
;
46
foreach
( $this->args as $name => $value ) {
47
if
( $first ) {
48
$first =
false
;
49
}
else
{
50
$s .=
', '
;
51
}
52
$s .=
"\"$name\":\""
.
53
str_replace(
'"'
,
'\\"'
, $value->__toString() ) .
'"'
;
54
}
55
$s .=
'}'
;
56
return
$s;
57
}
58
62
public
function
isEmpty
() {
63
return
!count( $this->args );
64
}
65
70
public
function
getArgument
( $index ) {
71
return
$this->args[$index] ??
false
;
72
}
73
74
public
function
getArguments
() {
75
return
$this->args
;
76
}
77
}
78
80
class_alias( PPCustomFrame_Hash::class,
'PPCustomFrame_Hash'
);
MediaWiki\Parser\PPCustomFrame_Hash
Expansion frame with custom arguments.
Definition
PPCustomFrame_Hash.php:29
MediaWiki\Parser\PPCustomFrame_Hash\__construct
__construct( $preprocessor, $args)
Definition
PPCustomFrame_Hash.php:38
MediaWiki\Parser\PPCustomFrame_Hash\$args
array $args
Definition
PPCustomFrame_Hash.php:32
MediaWiki\Parser\PPCustomFrame_Hash\getArgument
getArgument( $index)
Definition
PPCustomFrame_Hash.php:70
MediaWiki\Parser\PPCustomFrame_Hash\getArguments
getArguments()
Definition
PPCustomFrame_Hash.php:74
MediaWiki\Parser\PPCustomFrame_Hash\__toString
__toString()
Definition
PPCustomFrame_Hash.php:43
MediaWiki\Parser\PPCustomFrame_Hash\isEmpty
isEmpty()
Definition
PPCustomFrame_Hash.php:62
MediaWiki\Parser\PPFrame_Hash
An expansion frame, used as a context to expand the result of preprocessToObj()
Definition
PPFrame_Hash.php:35
MediaWiki\Parser\PPFrame_Hash\$preprocessor
Preprocessor $preprocessor
Definition
PPFrame_Hash.php:45
MediaWiki\Parser
Definition
BlockLevelPass.php:27
includes
parser
PPCustomFrame_Hash.php
Generated on Thu Nov 14 2024 01:24:54 for MediaWiki by
1.10.0