| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\AbuseFilter\Variables; |
| 4 | |
| 5 | class LazyLoadedVariable { |
| 6 | /** |
| 7 | * @var string The method used to compute the variable |
| 8 | */ |
| 9 | private $method; |
| 10 | /** |
| 11 | * @var array Parameters to be used with the specified method |
| 12 | */ |
| 13 | private $parameters; |
| 14 | |
| 15 | /** |
| 16 | * @param string $method |
| 17 | * @param array $parameters |
| 18 | */ |
| 19 | public function __construct( string $method, array $parameters ) { |
| 20 | $this->method = $method; |
| 21 | $this->parameters = $parameters; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * @return string |
| 26 | */ |
| 27 | public function getMethod(): string { |
| 28 | return $this->method; |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * @return array |
| 33 | */ |
| 34 | public function getParameters(): array { |
| 35 | return $this->parameters; |
| 36 | } |
| 37 | } |