diff options
author | thiemowmde <thiemo.kreuz@wikimedia.de> | 2022-12-05 21:37:13 +0100 |
---|---|---|
committer | thiemowmde <thiemo.kreuz@wikimedia.de> | 2022-12-05 21:37:13 +0100 |
commit | 70aa9c8e35bba4f817ecfbeb2b47f2cacf98e192 (patch) | |
tree | a43c0b05a24036246db191fc31e5723e7bb6d48f /includes/xml | |
parent | 6c175865f40982aee9c6657280d097ece81d69f6 (diff) | |
download | mediawikicore-70aa9c8e35bba4f817ecfbeb2b47f2cacf98e192.tar.gz mediawikicore-70aa9c8e35bba4f817ecfbeb2b47f2cacf98e192.zip |
Make use of ?:, ?? and ??= operators in mostly trivial cases
The motivation is to make the code less confusing. I hope this is the
case.
?? is an older PHP 7.0 feature.
??= was added in PHP 7.4, which we can finally use.
Change-Id: Id807affa52bd1151a74c064623b41d950a389560
Diffstat (limited to 'includes/xml')
-rw-r--r-- | includes/xml/Xml.php | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/includes/xml/Xml.php b/includes/xml/Xml.php index 7d4f01ddc577..824e1a0e52f0 100644 --- a/includes/xml/Xml.php +++ b/includes/xml/Xml.php @@ -148,10 +148,7 @@ class Xml { global $wgLang; $options = []; - if ( $selected === null ) { - $selected = ''; - } - $data = new XmlSelect( 'month', $id, $selected ); + $data = new XmlSelect( 'month', $id, $selected ?? '' ); if ( $allmonths !== null ) { $options[wfMessage( 'monthsall' )->text()] = $allmonths; |