Add Handler::getRouter()
[lhc/web/wiklou.git] / includes / Rest / SimpleHandler.php
1 <?php
2
3 namespace MediaWiki\Rest;
4
5 /**
6 * A handler base class which unpacks parameters from the path template and
7 * passes them as formal parameters to run().
8 *
9 * run() must be declared in the subclass. It cannot be declared as abstract
10 * here because it has a variable parameter list.
11 *
12 * @package MediaWiki\Rest
13 */
14 class SimpleHandler extends Handler {
15 public function execute() {
16 $params = array_values( $this->getRequest()->getPathParams() );
17 return $this->run( ...$params );
18 }
19 }