Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
GlobalUserInputWidget
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 3
56
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
12
 getJavaScriptClassName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getConfig
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
12
1<?php
2
3namespace MediaWiki\Extension\CentralAuth\Widget;
4
5use OOUI\TextInputWidget;
6
7class GlobalUserInputWidget extends TextInputWidget {
8
9    /** @var bool */
10    protected $excludeNamed;
11
12    /** @var bool */
13    protected $excludeTemp;
14
15    public function __construct( array $config = [] ) {
16        parent::__construct( $config );
17
18        if ( isset( $config['excludenamed'] ) ) {
19            $this->excludeNamed = $config['excludenamed'];
20        }
21
22        if ( isset( $config['excludetemp'] ) ) {
23            $this->excludeTemp = $config['excludetemp'];
24        }
25
26        // Initialization
27        $this->addClasses( [ 'mw-widget-userInputWidget' ] );
28    }
29
30    /** @inheritDoc */
31    protected function getJavaScriptClassName() {
32        return 'mw.widgets.GlobalUserInputWidget';
33    }
34
35    /** @inheritDoc */
36    public function getConfig( &$config ) {
37        $config['$overlay'] = true;
38
39        if ( $this->excludeNamed !== null ) {
40            $config['excludenamed'] = $this->excludeNamed;
41        }
42
43        if ( $this->excludeTemp !== null ) {
44            $config['excludetemp'] = $this->excludeTemp;
45        }
46
47        return parent::getConfig( $config );
48    }
49}