Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1430754
SimpleHandler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
SimpleHandler.php
View Options
<?php
namespace
MediaWiki\Rest
;
use
LogicException
;
/**
* A handler base class which unpacks parameters from the path template and
* passes them as formal parameters to run().
*
* run() must be declared in the subclass. It cannot be declared as abstract
* here because it has a variable parameter list.
*
* @stable to extend
* @package MediaWiki\Rest
*/
abstract
class
SimpleHandler
extends
Handler
{
public
function
execute
()
{
$paramSettings
=
$this
->
getParamSettings
();
$validatedParams
=
$this
->
getValidatedParams
();
$unvalidatedParams
=
[];
$params
=
[];
foreach
(
$this
->
getRequest
()->
getPathParams
()
as
$name
=>
$value
)
{
$source
=
$paramSettings
[
$name
][
self
::
PARAM_SOURCE
]
??
'unknown'
;
if
(
$source
!==
'path'
)
{
$unvalidatedParams
[]
=
$name
;
$params
[]
=
$value
;
}
else
{
$params
[]
=
$validatedParams
[
$name
];
}
}
if
(
$unvalidatedParams
)
{
throw
new
LogicException
(
'Path parameters were not validated: '
.
implode
(
', '
,
$unvalidatedParams
)
);
}
// @phan-suppress-next-line PhanUndeclaredMethod
return
$this
->
run
(
...
$params
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 19:30 (3 h, 53 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
47/a4/06890d980fd1376a4177d543193f
Default Alt Text
SimpleHandler.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment