Merge "Fix mime detection of easily-confused-with text/plain formats"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index 175088d..b57b69d 100644 (file)
@@ -304,15 +304,6 @@ class HTMLForm extends ContextSource {
                return $this->displayFormat === 'vform';
        }
 
-       /**
-        * Add the HTMLForm-specific JavaScript, if it hasn't been
-        * done already.
-        * @deprecated since 1.18 load modules with ResourceLoader instead
-        */
-       static function addJS() {
-               wfDeprecated( __METHOD__, '1.18' );
-       }
-
        /**
         * Get the HTMLFormField subclass for this descriptor.
         *
@@ -443,9 +434,12 @@ class HTMLForm extends ContextSource {
         * Validate all the fields, and call the submission callback
         * function if everything is kosher.
         * @throws MWException
-        * @return mixed Bool true == Successful submission, Bool false
-        *     == No submission attempted, anything else == Error to
-        *     display.
+        * @return bool|string|array|Status
+        *     - Bool true or a good Status object indicates success,
+        *     - Bool false indicates no submission was attempted,
+        *     - Anything else indicates failure. The value may be a fatal Status
+        *       object, an HTML string, or an array of arrays (message keys and
+        *       params) or strings (message keys)
         */
        function trySubmit() {
                $this->mWasSubmitted = true;
@@ -512,10 +506,9 @@ class HTMLForm extends ContextSource {
         * Set a callback to a function to do something with the form
         * once it's been successfully validated.
         *
-        * @param string $cb Function name.  The function will be passed
-        *     the output from HTMLForm::filterDataForSubmit, and must
-        *     return Bool true on success, Bool false if no submission
-        *     was attempted, or String HTML output to display on error.
+        * @param callable $cb The function will be passed the output from
+        *   HTMLForm::filterDataForSubmit and this HTMLForm object, and must
+        *   return as documented for HTMLForm::trySubmit
         *
         * @return HTMLForm $this for chaining calls (since 1.20)
         */
@@ -743,7 +736,7 @@ class HTMLForm extends ContextSource {
         * Moreover, when doing method chaining this should be the very last method
         * call just after prepareForm().
         *
-        * @param mixed $submitResult Mixed output from HTMLForm::trySubmit()
+        * @param bool|string|array|Status $submitResult Output from HTMLForm::trySubmit()
         *
         * @return Nothing, should be last call
         */
@@ -754,7 +747,7 @@ class HTMLForm extends ContextSource {
        /**
         * Returns the raw HTML generated by the form
         *
-        * @param mixed $submitResult Mixed output from HTMLForm::trySubmit()
+        * @param bool|string|array|Status $submitResult Output from HTMLForm::trySubmit()
         *
         * @return string
         */