Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
SpecialApiSandbox
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 execute
0.00% covered (danger)
0.00%
0 / 19
0.00% covered (danger)
0.00%
0 / 1
2
 getGroupName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * @license GPL-2.0-or-later
4 * @file
5 */
6
7namespace MediaWiki\Specials;
8
9use MediaWiki\SpecialPage\SpecialPage;
10
11/**
12 * Implements Special:ApiSandbox
13 *
14 * @since 1.27
15 * @ingroup SpecialPage
16 */
17class SpecialApiSandbox extends SpecialPage {
18
19    public function __construct() {
20        parent::__construct( 'ApiSandbox' );
21    }
22
23    /** @inheritDoc */
24    public function execute( $par ) {
25        $this->setHeaders();
26        $out = $this->getOutput();
27        $this->addHelpLink( 'Help:ApiSandbox' );
28
29        $out->addJsConfigVars(
30            'apihighlimits',
31            $this->getAuthority()->isAllowed( 'apihighlimits' )
32        );
33        $out->addModuleStyles( [
34            'mediawiki.special',
35            'mediawiki.hlist',
36        ] );
37        $out->addModules( [
38            'mediawiki.special.apisandbox',
39            'mediawiki.apipretty',
40        ] );
41        $out->wrapWikiMsg(
42            "<div id='mw-apisandbox'><div class='mw-apisandbox-nojs error'>\n$1\n</div></div>",
43            'apisandbox-jsonly'
44        );
45    }
46
47    /** @inheritDoc */
48    protected function getGroupName() {
49        return 'wiki';
50    }
51}
52
53/** @deprecated class alias since 1.41 */
54class_alias( SpecialApiSandbox::class, 'SpecialApiSandbox' );