Merge "VectorComponentUserLinks: Replace array_reduce with array_filter"

This commit is contained in:
jenkins-bot 2024-01-12 02:02:26 +00:00 committed by Gerrit Code Review
commit 6a40112ceb

View file

@ -320,13 +320,9 @@ class VectorComponentUserLinks implements VectorComponent {
] ); ] );
return [ return [
'is-wide' => array_reduce( 'is-wide' => array_filter(
[ $overflow, $notifications, $userPage, $userInterfacePreferences ], [ $overflow, $notifications, $userPage, $userInterfacePreferences ]
static function ( $carry, $list ) { ) !== [],
return count( $list ) + $carry;
},
0
),
'data-user-links-notifications' => $notificationsMenu->getTemplateData(), 'data-user-links-notifications' => $notificationsMenu->getTemplateData(),
'data-user-links-overflow' => $overflowMenu->getTemplateData(), 'data-user-links-overflow' => $overflowMenu->getTemplateData(),
'data-user-links-preferences' => $preferencesMenu->getTemplateData(), 'data-user-links-preferences' => $preferencesMenu->getTemplateData(),