MediaWiki
1.34.0
SimpleHandler.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\Rest
;
4
15
class
SimpleHandler
extends
Handler
{
16
public
function
execute
() {
17
$paramSettings = $this->
getParamSettings
();
18
$validatedParams
= $this->
getValidatedParams
();
19
$unvalidatedParams = [];
20
$params = [];
21
foreach
( $this->
getRequest
()->getPathParams() as $name => $value ) {
22
$source
= $paramSettings[$name][
self::PARAM_SOURCE
] ??
'unknown'
;
23
if
(
$source
!==
'path'
) {
24
$unvalidatedParams[] = $name;
25
$params[] = $value;
26
}
else
{
27
$params[] =
$validatedParams
[$name];
28
}
29
}
30
31
if
( $unvalidatedParams ) {
32
throw
new \LogicException(
33
'Path parameters were not validated: '
. implode(
', '
, $unvalidatedParams )
34
);
35
}
36
37
// @phan-suppress-next-line PhanUndeclaredMethod
38
return
$this->
run
( ...$params );
39
}
40
}
MediaWiki\Rest\Handler\getParamSettings
getParamSettings()
Fetch ParamValidator settings for parameters.
Definition:
Handler.php:112
MediaWiki\run
run()
Run the current MediaWiki instance; index.php just calls this.
Definition:
MediaWiki.php:523
MediaWiki\Rest\Handler\PARAM_SOURCE
const PARAM_SOURCE
(string) ParamValidator constant to specify the source of the parameter.
Definition:
Handler.php:15
MediaWiki\Rest\Handler
Definition:
Handler.php:9
MediaWiki\Rest\Handler\getValidatedParams
getValidatedParams()
Fetch the validated parameters.
Definition:
Handler.php:131
MediaWiki\Rest
MediaWiki\Rest\Handler\getRequest
getRequest()
Get the current request.
Definition:
Handler.php:62
MediaWiki\Rest\SimpleHandler\execute
execute()
Execute the handler.
Definition:
SimpleHandler.php:16
$source
$source
Definition:
mwdoc-filter.php:34
MediaWiki\Rest\Handler\$validatedParams
array null $validatedParams
Definition:
Handler.php:30
MediaWiki\Rest\SimpleHandler
Definition:
SimpleHandler.php:15
includes
Rest
SimpleHandler.php
Generated on Thu Dec 19 2019 14:54:47 for MediaWiki by
1.8.16