'checkmatrix' => HTMLCheckMatrix::class,
'cloner' => HTMLFormFieldCloner::class,
'autocompleteselect' => HTMLAutoCompleteSelectField::class,
+ 'language' => HTMLSelectLanguageField::class,
'date' => HTMLDateTimeField::class,
'time' => HTMLDateTimeField::class,
'datetime' => HTMLDateTimeField::class,
'user' => HTMLUserTextField::class,
'usersmultiselect' => HTMLUsersMultiselectField::class,
'titlesmultiselect' => HTMLTitlesMultiselectField::class,
+ 'namespacesmultiselect' => HTMLNamespacesMultiselectField::class,
];
public $mFieldData;
$setSection =& $loadedDescriptor;
if ( $section ) {
- $sectionParts = explode( '/', $section );
-
- while ( count( $sectionParts ) ) {
- $newName = array_shift( $sectionParts );
-
+ foreach ( explode( '/', $section ) as $newName ) {
if ( !isset( $setSection[$newName] ) ) {
$setSection[$newName] = [];
}
$valid = true;
$hoistedErrors = Status::newGood();
if ( $this->mValidationErrorMessage ) {
- foreach ( (array)$this->mValidationErrorMessage as $error ) {
+ foreach ( $this->mValidationErrorMessage as $error ) {
$hoistedErrors->fatal( ...$error );
}
} else {
/**
* Set a message to display on a validation error.
*
- * @param string|array $msg String or Array of valid inputs to wfMessage()
- * (so each entry can be either a String or Array)
+ * @param array $msg Array of valid inputs to wfMessage()
+ * (so each entry must itself be an array of arguments)
*
* @return HTMLForm $this for chaining calls (since 1.20)
*/