From 70aa9c8e35bba4f817ecfbeb2b47f2cacf98e192 Mon Sep 17 00:00:00 2001 From: thiemowmde Date: Mon, 5 Dec 2022 21:37:13 +0100 Subject: 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 --- includes/xml/Xml.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'includes/xml') 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; -- cgit v1.2.3