Fix invalid HTMLForm::setValidationErrorMessage doc
authorLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Tue, 19 Mar 2019 14:19:30 +0000 (15:19 +0100)
committerLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Tue, 19 Mar 2019 14:19:30 +0000 (15:19 +0100)
commit5d46ab1453c26535413feb305b04059ad5929abd
tree0177a17156f382c71cc8c2d075b131ef5ea891a4
parent5612194879bd4f5c7d3e7c75d42b08bf91b84428
Fix invalid HTMLForm::setValidationErrorMessage doc

The method has not actually supported scalar or single-level array
arguments for a while now; according to Michael Große, this ability was
lost in Ibb17bb61ac. No one seems to have noticed (indeed, MediaWiki
code search finds no callers at all [1]), so instead of trying to fix
it, let’s just update the documentation.

We can also remove a cast to array in trySubmit(), because if the value
wasn’t already an array, then converting it to a single-element array
and then trying to spread its only element into $hoistedErrors->fatal()
arguments still fails (“only arrays and Traversables can be unpacked”).

[1]: https://codesearch.wmflabs.org/search/?q=setValidationErrorMessage

Change-Id: I8c292ec62ef4aec89217e86a75d7f2e88111f43f
includes/htmlform/HTMLForm.php