Merge "Adjust type hints in htmlform related classes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 5 Jul 2019 21:32:55 +0000 (21:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 5 Jul 2019 21:32:55 +0000 (21:32 +0000)
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLFormField.php
includes/htmlform/fields/HTMLCheckMatrix.php
includes/htmlform/fields/HTMLFormFieldWithButton.php

index 99e387a..a7cef3c 100644 (file)
@@ -184,6 +184,7 @@ class HTMLForm extends ContextSource {
        protected $mFieldTree = [];
        protected $mShowReset = false;
        protected $mShowSubmit = true;
+       /** @var string[] */
        protected $mSubmitFlags = [ 'primary', 'progressive' ];
        protected $mShowCancel = false;
        protected $mCancelTarget;
index ff805d8..590b9e7 100644 (file)
@@ -367,7 +367,7 @@ abstract class HTMLFormField {
         * or the input's default value if it has not been set.
         *
         * @param WebRequest $request
-        * @return string The value
+        * @return mixed The value
         */
        public function loadDataFromRequest( $request ) {
                if ( $request->getCheck( $this->mName ) ) {
@@ -653,7 +653,7 @@ abstract class HTMLFormField {
 
        /**
         * Get a FieldLayout (or subclass thereof) to wrap this field in when using OOUI output.
-        * @param string $inputField
+        * @param OOUI\Widget $inputField
         * @param array $config
         * @return OOUI\FieldLayout|OOUI\ActionFieldLayout
         */
@@ -1032,7 +1032,7 @@ abstract class HTMLFormField {
         * Recursively forces values in an array to strings, because issues arise
         * with integer 0 as a value.
         *
-        * @param array $array
+        * @param array|string $array
         * @return array|string
         */
        public static function forceToStringRecursive( $array ) {
index 8ce3c83..8e51858 100644 (file)
@@ -196,7 +196,7 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable {
         * line above the options in the case of a checkbox matrix, i.e. it's always
         * a "vertical-label".
         *
-        * @param string $value The value to set the input to
+        * @param string|array $value The value to set the input to
         *
         * @return string Complete HTML table row
         */
index be8f7d8..4372cd1 100644 (file)
@@ -18,7 +18,7 @@ class HTMLFormFieldWithButton extends HTMLFormField {
        /** @var string $mButtonType Value for the button in this field */
        protected $mButtonValue;
 
-       /** @var string $mButtonType Value for the button in this field */
+       /** @var string[] $mButtonType Value for the button in this field */
        protected $mButtonFlags = [ 'progressive' ];
 
        public function __construct( $info ) {