Better grouping for code adding elements to arrays

Change-Id: I7cc8c810f0dcf1ee84b9d5f14967ec2568e3e0be
Follow-up: I50377746f01749b058c39fd8229f9d566224cc43
This commit is contained in:
Daimona Eaytoy 2019-09-03 19:38:57 +02:00
parent 95d97f6f42
commit 9881ea93be
5 changed files with 12 additions and 9 deletions

View file

@ -255,17 +255,18 @@ class FileDeleteForm {
$wgOut->enableOOUI();
$fields = [];
$fields[] = new OOUI\LabelWidget( [ 'label' => new OOUI\HtmlSnippet(
$this->prepareMessage( 'filedelete-intro' ) ) ]
);
$options = Xml::listDropDownOptions(
$wgOut->msg( 'filedelete-reason-dropdown' )->inContentLanguage()->text(),
[ 'other' => $wgOut->msg( 'filedelete-reason-otherlist' )->inContentLanguage()->text() ]
);
$options = Xml::listDropDownOptionsOoui( $options );
$fields = [];
$fields[] = new OOUI\LabelWidget( [ 'label' => new OOUI\HtmlSnippet(
$this->prepareMessage( 'filedelete-intro' ) ) ]
);
$fields[] = new OOUI\FieldLayout(
new OOUI\DropdownInputWidget( [
'name' => 'wpDeleteReasonList',

View file

@ -311,6 +311,7 @@ class LinkFilter {
*/
public static function makeLikeArray( $filterEntry, $protocol = 'http://' ) {
$db = wfGetDB( DB_REPLICA );
$like = [];
$target = $protocol . $filterEntry;
$bits = wfParseUrl( $target );
@ -338,7 +339,6 @@ class LinkFilter {
}
}
$like = [];
$like[] = $bits['scheme'] . $bits['delimiter'] . $bits['host'];
if ( $subdomains ) {

View file

@ -140,9 +140,10 @@ class ApiBlock extends ApiBase {
$this->dieStatus( $this->errorArrayToStatus( $retval ) );
}
list( $target, /*...*/ ) = SpecialBlock::getTargetAndType( $params['user'] );
$res = [];
$res['user'] = $params['user'];
list( $target, /*...*/ ) = SpecialBlock::getTargetAndType( $params['user'] );
$res['userID'] = $target instanceof User ? $target->getId() : 0;
$block = DatabaseBlock::newFromTarget( $target, null, true );

View file

@ -793,8 +793,8 @@ class ApiUpload extends ApiBase {
}
}
$result = [];
// No errors, no warnings: do the upload
$result = [];
if ( $this->mParams['async'] ) {
$progress = UploadBase::getSessionStatus( $this->getUser(), $this->mParams['filekey'] );
if ( $progress && $progress['result'] === 'Poll' ) {

View file

@ -1929,13 +1929,14 @@ class Article implements Page {
$outputPage->enableOOUI();
$fields = [];
$options = Xml::listDropDownOptions(
$ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->text(),
[ 'other' => $ctx->msg( 'deletereasonotherlist' )->inContentLanguage()->text() ]
);
$options = Xml::listDropDownOptionsOoui( $options );
$fields = [];
$fields[] = new OOUI\FieldLayout(
new OOUI\DropdownInputWidget( [
'name' => 'wpDeleteReasonList',