Bring in HISTORY for 1.27.6/1.30.2/1.31.2/1.32.2
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index 99671c0..d071478 100644 (file)
@@ -21,8 +21,6 @@
  * @file
  */
 
-use Wikimedia\ObjectFactory;
-
 /**
  * Object handling generic submission, CSRF protection, layout and
  * other logic for UI forms. in a reusable manner.
@@ -304,12 +302,11 @@ class HTMLForm extends ContextSource {
 
                switch ( $displayFormat ) {
                        case 'vform':
-                               return ObjectFactory::constructClassInstance( VFormHTMLForm::class, $arguments );
+                               return new VFormHTMLForm( ...$arguments );
                        case 'ooui':
-                               return ObjectFactory::constructClassInstance( OOUIHTMLForm::class, $arguments );
+                               return new OOUIHTMLForm( ...$arguments );
                        default:
-                               /** @var HTMLForm $form */
-                               $form = ObjectFactory::constructClassInstance( self::class, $arguments );
+                               $form = new self( ...$arguments );
                                $form->setDisplayFormat( $displayFormat );
                                return $form;
                }
@@ -1062,10 +1059,10 @@ class HTMLForm extends ContextSource {
        }
 
        /**
-        * Set whether the HTML form can be collapsed.
+        * Enable collapsible mode, and set whether the form is collapsed by default.
         *
         * @since 1.34
-        * @param bool $collapsedByDefault (optional) whether the form is collapsed by default
+        * @param bool $collapsedByDefault Whether the form is collapsed by default (optional).
         * @return HTMLForm $this for chaining calls
         */
        public function setCollapsibleOptions( $collapsedByDefault = false ) {
@@ -1277,20 +1274,6 @@ class HTMLForm extends ContextSource {
                return $this->displaySection( $this->mFieldTree, $this->mTableId );
        }
 
-       /**
-        * Format and display an error message stack.
-        *
-        * @param string|array|Status $errors
-        *
-        * @deprecated since 1.28, use getErrorsOrWarnings() instead
-        *
-        * @return string
-        */
-       public function getErrors( $errors ) {
-               wfDeprecated( __METHOD__ );
-               return $this->getErrorsOrWarnings( $errors, 'error' );
-       }
-
        /**
         * Returns a formatted list of errors or warnings from the given elements.
         *
@@ -1373,21 +1356,6 @@ class HTMLForm extends ContextSource {
                return $this;
        }
 
-       /**
-        * Identify that the submit button in the form has a progressive action
-        * @since 1.25
-        * @deprecated since 1.32, No need to call. Submit button already
-        * has a progressive action form.
-        *
-        * @return HTMLForm $this for chaining calls (since 1.28)
-        */
-       public function setSubmitProgressive() {
-               wfDeprecated( __METHOD__, '1.32' );
-               $this->mSubmitFlags = [ 'progressive', 'primary' ];
-
-               return $this;
-       }
-
        /**
         * Set the text for the submit button to a message
         * @since 1.19