mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-23 23:44:53 +00:00
Merge "Use short array destructuring instead of list()"
This commit is contained in:
commit
ef5f45d3bd
|
@ -931,7 +931,7 @@ abstract class EchoDiscussionParser {
|
|||
return true;
|
||||
}
|
||||
|
||||
list( , $foundUser ) = $userData;
|
||||
[ , $foundUser ] = $userData;
|
||||
$userNameUtils = MediaWikiServices::getInstance()->getUserNameUtils();
|
||||
|
||||
return $userNameUtils->getCanonical( $foundUser, UserNameUtils::RIGOR_NONE ) ===
|
||||
|
@ -1008,7 +1008,7 @@ abstract class EchoDiscussionParser {
|
|||
continue;
|
||||
}
|
||||
|
||||
list( $signaturePos, $user ) = $userData;
|
||||
[ $signaturePos, $user ] = $userData;
|
||||
|
||||
$signature = substr( $line, $signaturePos );
|
||||
$output[$user] = $signature;
|
||||
|
|
|
@ -191,9 +191,9 @@ class EchoDiffParser {
|
|||
$change = null;
|
||||
}
|
||||
// @@ -start,numLines +start,numLines @@
|
||||
list( , $left, $right ) = explode( ' ', $line, 3 );
|
||||
list( $this->leftPos ) = explode( ',', substr( $left, 1 ), 2 );
|
||||
list( $this->rightPos ) = explode( ',', substr( $right, 1 ), 2 );
|
||||
[ , $left, $right ] = explode( ' ', $line, 3 );
|
||||
[ $this->leftPos ] = explode( ',', substr( $left, 1 ), 2 );
|
||||
[ $this->rightPos ] = explode( ',', substr( $right, 1 ), 2 );
|
||||
$this->leftPos = (int)$this->leftPos;
|
||||
$this->rightPos = (int)$this->rightPos;
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ class EchoForeignNotifications {
|
|||
$data = [];
|
||||
foreach ( $wikis as $wiki ) {
|
||||
$siteFromDB = $wgConf->siteFromDB( $wiki );
|
||||
list( $major, $minor ) = $siteFromDB;
|
||||
[ $major, $minor ] = $siteFromDB;
|
||||
$server = $wgConf->get( 'wgServer', $wiki, $major, [ 'lang' => $minor, 'site' => $major ] );
|
||||
$scriptPath = $wgConf->get( 'wgScriptPath', $wiki, $major, [ 'lang' => $minor, 'site' => $major ] );
|
||||
$articlePath = $wgConf->get( 'wgArticlePath', $wiki, $major, [ 'lang' => $minor, 'site' => $major ] );
|
||||
|
@ -238,7 +238,7 @@ class EchoForeignNotifications {
|
|||
if ( $siteFromDB === null ) {
|
||||
$siteFromDB = $wgConf->siteFromDB( $wikiId );
|
||||
}
|
||||
list( $site, $langCode ) = $siteFromDB;
|
||||
[ $site, $langCode ] = $siteFromDB;
|
||||
|
||||
// try to fetch site name for this specific wiki, or fallback to the
|
||||
// general project's sitename if there is no override
|
||||
|
|
|
@ -297,7 +297,7 @@ abstract class EchoEventPresentationModel implements JsonSerializable, MessageLo
|
|||
* the user is visible or not.
|
||||
* @par Example:
|
||||
* @code
|
||||
* list( $formattedName, $genderName ) = $this->getAgentForOutput();
|
||||
* [ $formattedName, $genderName ] = $this->getAgentForOutput();
|
||||
* $msg->params( $formattedName, $genderName );
|
||||
* @endcode
|
||||
*/
|
||||
|
@ -330,7 +330,7 @@ abstract class EchoEventPresentationModel implements JsonSerializable, MessageLo
|
|||
*/
|
||||
final protected function getMessageWithAgent( $key ) {
|
||||
$msg = $this->msg( $key );
|
||||
list( $formattedName, $genderName ) = $this->getAgentForOutput();
|
||||
[ $formattedName, $genderName ] = $this->getAgentForOutput();
|
||||
$msg->params( $formattedName, $genderName );
|
||||
return $msg;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ class EchoUserRightsPresentationModel extends EchoEventPresentationModel {
|
|||
}
|
||||
|
||||
public function getHeaderMessage() {
|
||||
list( $formattedName, $genderName ) = $this->getAgentForOutput();
|
||||
[ $formattedName, $genderName ] = $this->getAgentForOutput();
|
||||
$add = array_map(
|
||||
[ $this->language, 'embedBidi' ],
|
||||
$this->getLocalizedGroupNames( array_values( $this->event->getExtraParam( 'add', [] ) ) )
|
||||
|
|
|
@ -42,7 +42,7 @@ class RemoveOrphanedEvents extends LoggedUpdateMaintenance {
|
|||
$targetsProcessedTotal = 0;
|
||||
while ( $startId < $maxId ) {
|
||||
$startId += $this->getBatchSize() * 1000;
|
||||
list( $eventsProcessed, $targetsProcessed ) = $this->doMajorBatch( $startId );
|
||||
[ $eventsProcessed, $targetsProcessed ] = $this->doMajorBatch( $startId );
|
||||
$eventsProcessedTotal += $eventsProcessed;
|
||||
$targetsProcessedTotal += $targetsProcessed;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ class EchoUserLocatorTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testLocateTalkPageOwner( $message, $expect, Title $title = null ) {
|
||||
if ( $expect instanceof Closure ) {
|
||||
list( $expect, $title ) = $expect();
|
||||
[ $expect, $title ] = $expect();
|
||||
}
|
||||
$event = $this->createMock( EchoEvent::class );
|
||||
$event->method( 'getTitle' )
|
||||
|
@ -103,7 +103,7 @@ class EchoUserLocatorTest extends MediaWikiIntegrationTestCase {
|
|||
* @dataProvider locateArticleCreatorProvider
|
||||
*/
|
||||
public function testLocateArticleCreator( $message, $initialize ) {
|
||||
list( $expect, $title, $user ) = $initialize();
|
||||
[ $expect, $title, $user ] = $initialize();
|
||||
$this->getServiceContainer()->getWikiPageFactory()->newFromTitle( $title )->doUserEditContent(
|
||||
/* $content = */ ContentHandler::makeContent( 'content', $title ),
|
||||
/* $user = */ $user,
|
||||
|
|
Loading…
Reference in a new issue