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 /includes/api/ApiFeedWatchlist.php | |
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 'includes/api/ApiFeedWatchlist.php')
-rw-r--r-- | includes/api/ApiFeedWatchlist.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 393e53622788..c21ac12e821c 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -144,7 +144,7 @@ class ApiFeedWatchlist extends ApiBase { ' [' . $this->getConfig()->get( 'LanguageCode' ) . ']'; $feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL(); - $feedFormat = isset( $params['feedformat'] ) ? $params['feedformat'] : 'rss'; + $feedFormat = $params['feedformat'] ?? 'rss'; $msg = wfMessage( 'watchlist' )->inContentLanguage()->escaped(); $feed = new $feedClasses[$feedFormat] ( $feedTitle, $msg, $feedUrl ); @@ -201,7 +201,7 @@ class ApiFeedWatchlist extends ApiBase { } else { $titleUrl = $title->getFullURL( $curidParam ); } - $comment = isset( $info['comment'] ) ? $info['comment'] : null; + $comment = $info['comment'] ?? null; // Create an anchor to section. // The anchor won't work for sections that have dupes on page |