}
function getInputHTML( $value ) {
- $attribs = array(
+ $attribs = [
'id' => $this->mID,
'cols' => $this->getCols(),
'rows' => $this->getRows(),
'spellcheck' => $this->getSpellCheck(),
- ) + $this->getTooltipAndAccessKey();
+ ] + $this->getTooltipAndAccessKey();
if ( $this->mClass !== '' ) {
$attribs['class'] = $this->mClass;
}
- $allowedParams = array(
+ $allowedParams = [
'placeholder',
'tabindex',
'disabled',
'readonly',
'required',
'autofocus'
- );
+ ];
$attribs += $this->getAttributes( $allowedParams );
return Html::textarea( $this->mName, $value, $attribs );
}
function getInputOOUI( $value ) {
+ if ( isset( $this->mParams['cols'] ) ) {
+ throw new Exception( "OOUIHTMLForm does not support the 'cols' parameter for textareas" );
+ }
+
$attribs = $this->getTooltipAndAccessKey();
if ( $this->mClass !== '' ) {
- $attribs['classes'] = array( $this->mClass );
+ $attribs['classes'] = [ $this->mClass ];
}
- $allowedParams = array(
+ $allowedParams = [
'placeholder',
'tabindex',
'disabled',
'readonly',
'required',
'autofocus',
- );
+ ];
- $attribs += $this->getAttributes( $allowedParams, array(
+ $attribs += $this->getAttributes( $allowedParams, [
'tabindex' => 'tabIndex',
'readonly' => 'readOnly',
- ) );
+ ] );
- return new OOUI\TextInputWidget( array(
+ return new OOUI\TextInputWidget( [
'id' => $this->mID,
'name' => $this->mName,
'multiline' => true,
'value' => $value,
- ) + $attribs );
+ 'rows' => $this->getRows(),
+ ] + $attribs );
}
}