aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiComparePages.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2022-10-21 15:32:38 +1100
committerTim Starling <tstarling@wikimedia.org>2022-10-21 15:33:37 +1100
commit0077c5da15aab081125ee1c72cc4d95225e4ff5f (patch)
tree27e2128c722cb91eb72546bf289d1845a5974d52 /includes/api/ApiComparePages.php
parentd2b199c51762e417c75778ca9016b8dc62c1bb67 (diff)
downloadmediawikicore-0077c5da15aab081125ee1c72cc4d95225e4ff5f.tar.gz
mediawikicore-0077c5da15aab081125ee1c72cc4d95225e4ff5f.zip
Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
Diffstat (limited to 'includes/api/ApiComparePages.php')
-rw-r--r--includes/api/ApiComparePages.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php
index c30eb7da3820..4275fc6242fb 100644
--- a/includes/api/ApiComparePages.php
+++ b/includes/api/ApiComparePages.php
@@ -97,7 +97,7 @@ class ApiComparePages extends ApiBase {
$this->getMain()->setCacheMode( 'public' );
// Get the 'from' RevisionRecord
- list( $fromRev, $fromRelRev, $fromValsRev ) = $this->getDiffRevision( 'from', $params );
+ [ $fromRev, $fromRelRev, $fromValsRev ] = $this->getDiffRevision( 'from', $params );
// Get the 'to' RevisionRecord
if ( $params['torelative'] !== null ) {
@@ -112,7 +112,7 @@ class ApiComparePages extends ApiBase {
switch ( $params['torelative'] ) {
case 'prev':
// Swap 'from' and 'to'
- list( $toRev, $toRelRev, $toValsRev ) = [ $fromRev, $fromRelRev, $fromValsRev ];
+ [ $toRev, $toRelRev, $toValsRev ] = [ $fromRev, $fromRelRev, $fromValsRev ];
$fromRev = $this->revisionStore->getPreviousRevision( $toRelRev );
$fromRelRev = $fromRev;
$fromValsRev = $fromRev;
@@ -171,7 +171,7 @@ class ApiComparePages extends ApiBase {
break;
}
} else {
- list( $toRev, $toRelRev, $toValsRev ) = $this->getDiffRevision( 'to', $params );
+ [ $toRev, $toRelRev, $toValsRev ] = $this->getDiffRevision( 'to', $params );
}
// Handle missing from or to revisions (should never happen)