MediaWiki
REL1_31
DeferredStringifier.php
Go to the documentation of this file.
1
<?php
27
class
DeferredStringifier
{
29
private
$callback
;
30
32
private
$params
;
33
35
private
$result
;
36
41
public
function
__construct
(
$callback
/*...*/
) {
42
$this->params = func_get_args();
43
array_shift( $this->params );
44
$this->callback =
$callback
;
45
}
46
52
public
function
__toString
() {
53
if
( $this->result ===
null
) {
54
$this->result = call_user_func_array( $this->callback, $this->params );
55
}
56
return
$this->result
;
57
}
58
}
DeferredStringifier
Definition
DeferredStringifier.php:27
DeferredStringifier\$result
string $result
Definition
DeferredStringifier.php:35
DeferredStringifier\$callback
callable $callback
Callback used for result string generation.
Definition
DeferredStringifier.php:29
DeferredStringifier\__toString
__toString()
Get the string generated from the callback.
Definition
DeferredStringifier.php:52
DeferredStringifier\__construct
__construct( $callback)
Definition
DeferredStringifier.php:41
DeferredStringifier\$params
array $params
Definition
DeferredStringifier.php:32
includes
libs
DeferredStringifier.php
Generated on Mon Nov 25 2024 15:34:56 for MediaWiki by
1.10.0