Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
HTMLSelectNamespaceWithButton
0.00% covered (danger)
0.00%
0 / 5
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 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getInputHTML
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getFieldLayoutOOUI
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\HTMLForm\Field;
4
5use MediaWiki\HTMLForm\HTMLFormActionFieldLayout;
6
7/**
8 * Creates a Html::namespaceSelector input field with a button assigned to the input field.
9 *
10 * @stable to extend
11 */
12class HTMLSelectNamespaceWithButton extends HTMLSelectNamespace {
13    /** @var HTMLFormFieldWithButton */
14    protected $mClassWithButton = null;
15
16    /**
17     * @stable to call
18     * @inheritDoc
19     */
20    public function __construct( $info ) {
21        $this->mClassWithButton = new HTMLFormFieldWithButton( $info );
22        parent::__construct( $info );
23    }
24
25    public function getInputHTML( $value ) {
26        return $this->mClassWithButton->getElement( parent::getInputHTML( $value ) );
27    }
28
29    protected function getFieldLayoutOOUI( $inputField, $config ) {
30        $buttonWidget = $this->mClassWithButton->getInputOOUI( '' );
31        return new HTMLFormActionFieldLayout( $inputField, $buttonWidget, $config );
32    }
33}
34
35/** @deprecated class alias since 1.42 */
36class_alias( HTMLSelectNamespaceWithButton::class, 'HTMLSelectNamespaceWithButton' );