wiki.techinc.nl/includes/Rest/Handler/HelloHandler.php
James D. Forrester 4f2d1efdda Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse
Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
2020-01-10 09:32:25 -08:00

30 lines
544 B
PHP

<?php
namespace MediaWiki\Rest\Handler;
use MediaWiki\Rest\SimpleHandler;
use Wikimedia\ParamValidator\ParamValidator;
/**
* Example handler
* @unstable
*/
class HelloHandler extends SimpleHandler {
public function run( $name ) {
return [ 'message' => "Hello, $name!" ];
}
public function needsWriteAccess() {
return false;
}
public function getParamSettings() {
return [
'name' => [
self::PARAM_SOURCE => 'path',
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
],
];
}
}