X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLFormElement.php;h=1e4460a0220496ca223fea78cd62ff5319896ebb;hb=eefd0e31facfd32abbfa0effe6e1906f09c54cd5;hp=2830b9c258e265734c4c0595ffe43a49619f341a;hpb=77e3624caba072521fbc1826af2d47f9b29f4032;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLFormElement.php b/includes/htmlform/HTMLFormElement.php index 2830b9c258..1e4460a022 100644 --- a/includes/htmlform/HTMLFormElement.php +++ b/includes/htmlform/HTMLFormElement.php @@ -5,6 +5,7 @@ * (defined in htmlform.Element.js) picks up the extra config when constructed using OO.ui.infuse(). * * Currently only supports passing 'hide-if' data. + * @phan-file-suppress PhanUndeclaredMethod */ trait HTMLFormElement { @@ -13,8 +14,8 @@ trait HTMLFormElement { public function initializeHTMLFormElement( array $config = [] ) { // Properties - $this->hideIf = isset( $config['hideIf'] ) ? $config['hideIf'] : null; - $this->modules = isset( $config['modules'] ) ? $config['modules'] : []; + $this->hideIf = $config['hideIf'] ?? null; + $this->modules = $config['modules'] ?? []; // Initialization if ( $this->hideIf ) { @@ -33,33 +34,3 @@ trait HTMLFormElement { } ); } } - -class HTMLFormFieldLayout extends OOUI\FieldLayout { - use HTMLFormElement; - - public function __construct( $fieldWidget, array $config = [] ) { - parent::__construct( $fieldWidget, $config ); - - // Traits - $this->initializeHTMLFormElement( $config ); - } - - protected function getJavaScriptClassName() { - return 'mw.htmlform.FieldLayout'; - } -} - -class HTMLFormActionFieldLayout extends OOUI\ActionFieldLayout { - use HTMLFormElement; - - public function __construct( $fieldWidget, $buttonWidget = false, array $config = [] ) { - parent::__construct( $fieldWidget, $buttonWidget, $config ); - - // Traits - $this->initializeHTMLFormElement( $config ); - } - - protected function getJavaScriptClassName() { - return 'mw.htmlform.ActionFieldLayout'; - } -}