Skip to content

Commit c727588

Browse files
authored
Use null coalescing assignment operator for modules and plugins (joomla#44972)
1 parent a9c5a1b commit c727588

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

administrator/modules/mod_menu/src/Menu/CssMenu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ protected function preprocess($parent)
284284
continue;
285285
}
286286

287-
$item->scope = $item->scope ?? 'default';
288-
$item->icon = $item->icon ?? '';
287+
$item->scope ??= 'default';
288+
$item->icon ??= '';
289289

290290
// Whether this scope can be displayed. Applies only to preset items. Db driven items should use un/published state.
291291
if (($item->scope === 'help' && $this->params->get('showhelp', 1) == 0) || ($item->scope === 'edit' && !$this->params->get('shownew', 1))) {

plugins/editors/tinymce/src/PluginTraits/XTDButtons.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function tinyButtons($buttons, array $options = []): array
7474
if ($link && $link[0] !== '#') {
7575
$link = str_contains($link, '&') ? htmlspecialchars_decode($link) : $link;
7676
$link = Uri::base(true) . '/' . $link;
77-
$options['src'] = $options['src'] ?? $link;
77+
$options['src'] ??= $link;
7878
}
7979

8080
// Set action to "modal" for legacy buttons, when possible
@@ -85,9 +85,9 @@ private function tinyButtons($buttons, array $options = []): array
8585
$wa->useScript('joomla.dialog');
8686
$legacyModal = false;
8787

88-
$options['popupType'] = $options['popupType'] ?? 'iframe';
89-
$options['textHeader'] = $options['textHeader'] ?? $title;
90-
$options['iconHeader'] = $options['iconHeader'] ?? 'icon-' . $icon;
88+
$options['popupType'] ??= 'iframe';
89+
$options['textHeader'] ??= $title;
90+
$options['iconHeader'] ??= 'icon-' . $icon;
9191
}
9292

9393
$coreButton = [];

plugins/system/debug/src/DataCollector/ProfileCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function setRequestEndTime($time): self
263263
*/
264264
public function collect(): array
265265
{
266-
$this->requestEndTime = $this->requestEndTime ?? microtime(true);
266+
$this->requestEndTime ??= microtime(true);
267267

268268
$start = $this->requestStartTime;
269269

0 commit comments

Comments
 (0)