2021-01-02 14:01:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter\Variables;
|
|
|
|
|
|
|
|
class LazyLoadedVariable {
|
|
|
|
/**
|
|
|
|
* @var string The method used to compute the variable
|
|
|
|
*/
|
|
|
|
private $method;
|
|
|
|
/**
|
|
|
|
* @var array Parameters to be used with the specified method
|
|
|
|
*/
|
|
|
|
private $parameters;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $method
|
|
|
|
* @param array $parameters
|
|
|
|
*/
|
|
|
|
public function __construct( string $method, array $parameters ) {
|
|
|
|
$this->method = $method;
|
|
|
|
$this->parameters = $parameters;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2021-07-21 18:51:12 +00:00
|
|
|
public function getMethod(): string {
|
2021-01-02 14:01:00 +00:00
|
|
|
return $this->method;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
2021-07-21 18:51:12 +00:00
|
|
|
public function getParameters(): array {
|
2021-01-02 14:01:00 +00:00
|
|
|
return $this->parameters;
|
|
|
|
}
|
|
|
|
}
|