Merge "MemoizedCallable: Add test for memoized closure"
[lhc/web/wiklou.git] / includes / htmlform / HTMLTextAreaField.php
index e4f78b2..b05fd7c 100644 (file)
@@ -22,56 +22,61 @@ class HTMLTextAreaField extends HTMLFormField {
        }
 
        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 );
        }
 }