diff options
author | Bartosz DziewoĆski <matma.rex@gmail.com> | 2017-10-07 00:17:58 +0200 |
---|---|---|
committer | James D. Forrester <jforrester@wikimedia.org> | 2018-05-30 18:06:13 -0700 |
commit | 485f66f1744fea056e20a5bef619989bf1749202 (patch) | |
tree | 10f1fa9496adf8a6057e28138c941bb2671fbeec /maintenance/storage | |
parent | b191e5e860f24e1dd05e3d3d782364e4ea75b176 (diff) | |
download | mediawikicore-485f66f1744fea056e20a5bef619989bf1749202.tar.gz mediawikicore-485f66f1744fea056e20a5bef619989bf1749202.zip |
Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '
(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)
Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).
Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
Diffstat (limited to 'maintenance/storage')
-rw-r--r-- | maintenance/storage/moveToExternal.php | 2 | ||||
-rw-r--r-- | maintenance/storage/testCompression.php | 2 | ||||
-rw-r--r-- | maintenance/storage/trackBlobs.php | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/maintenance/storage/moveToExternal.php b/maintenance/storage/moveToExternal.php index 9bb554c64c81..639ef5846fc4 100644 --- a/maintenance/storage/moveToExternal.php +++ b/maintenance/storage/moveToExternal.php @@ -43,7 +43,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { } else { $maxID = $dbw->selectField( 'text', 'MAX(old_id)', '', $fname ); } - $minID = isset( $options['s'] ) ? $options['s'] : 1; + $minID = $options['s'] ?? 1; moveToExternal( $cluster, $maxID, $minID ); } diff --git a/maintenance/storage/testCompression.php b/maintenance/storage/testCompression.php index c3ed4fce0c10..7cac7287c171 100644 --- a/maintenance/storage/testCompression.php +++ b/maintenance/storage/testCompression.php @@ -45,7 +45,7 @@ if ( isset( $options['limit'] ) ) { $limit = 1000; $untilHappy = true; } -$type = isset( $options['type'] ) ? $options['type'] : ConcatenatedGzipHistoryBlob::class; +$type = $options['type'] ?? ConcatenatedGzipHistoryBlob::class; $dbr = $this->getDB( DB_REPLICA ); $revQuery = Revision::getQueryInfo( [ 'page', 'text' ] ); diff --git a/maintenance/storage/trackBlobs.php b/maintenance/storage/trackBlobs.php index 36b6f5b459af..2dd48caf98df 100644 --- a/maintenance/storage/trackBlobs.php +++ b/maintenance/storage/trackBlobs.php @@ -122,7 +122,7 @@ class TrackBlobs { return [ 'cluster' => $m[1], 'id' => intval( $m[2] ), - 'hash' => isset( $m[3] ) ? $m[3] : null + 'hash' => $m[3] ?? null ]; } |