aboutsummaryrefslogtreecommitdiffstats
path: root/includes/xml
diff options
context:
space:
mode:
authorthiemowmde <thiemo.kreuz@wikimedia.de>2022-12-05 21:37:13 +0100
committerthiemowmde <thiemo.kreuz@wikimedia.de>2022-12-05 21:37:13 +0100
commit70aa9c8e35bba4f817ecfbeb2b47f2cacf98e192 (patch)
treea43c0b05a24036246db191fc31e5723e7bb6d48f /includes/xml
parent6c175865f40982aee9c6657280d097ece81d69f6 (diff)
downloadmediawikicore-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.php5
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;