aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryBase.php
diff options
context:
space:
mode:
authorthiemowmde <thiemo.kreuz@wikimedia.de>2022-12-22 08:17:13 +0100
committerthiemowmde <thiemo.kreuz@wikimedia.de>2022-12-23 08:35:44 +0100
commit8b49357b25cb5606ae724fe1077636d7312d15e7 (patch)
tree7fc1ce36ddf40b22d698b2731425027e5d50a3c9 /includes/api/ApiQueryBase.php
parentfbbc7dce7faac67eb3138e8827e3433010d23ea0 (diff)
downloadmediawikicore-8b49357b25cb5606ae724fe1077636d7312d15e7.tar.gz
mediawikicore-8b49357b25cb5606ae724fe1077636d7312d15e7.zip
Replace some tivial ??= with even more trivial ??
Patch Ifa7a9bc replaced some longer `=== null` constructs with the new ??= operator we have since PHP 7.4. However, some of these can be simplified even more with the ?? operator we have since PHP 7.0. Follow-Up: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b Change-Id: I7b05e723810558bb5437adc97eab54ca04d38c06
Diffstat (limited to 'includes/api/ApiQueryBase.php')
-rw-r--r--includes/api/ApiQueryBase.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php
index d74e362e88f0..98b9bd971686 100644
--- a/includes/api/ApiQueryBase.php
+++ b/includes/api/ApiQueryBase.php
@@ -493,16 +493,16 @@ abstract class ApiQueryBase extends ApiBase {
* @return bool Whether the element fit in the result
*/
protected function addPageSubItem( $pageId, $item, $elemname = null ) {
- $elemname ??= $this->getModulePrefix();
-
$result = $this->getResult();
$fit = $result->addValue( [ 'query', 'pages', $pageId,
$this->getModuleName() ], null, $item );
if ( !$fit ) {
return false;
}
- $result->addIndexedTagName( [ 'query', 'pages', $pageId,
- $this->getModuleName() ], $elemname );
+ $result->addIndexedTagName(
+ [ 'query', 'pages', $pageId, $this->getModuleName() ],
+ $elemname ?? $this->getModulePrefix()
+ );
return true;
}