mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-23 23:33:54 +00:00
Merge "VectorComponentUserLinks: Replace array_reduce with array_filter"
This commit is contained in:
commit
6a40112ceb
|
@ -320,13 +320,9 @@ class VectorComponentUserLinks implements VectorComponent {
|
|||
] );
|
||||
|
||||
return [
|
||||
'is-wide' => array_reduce(
|
||||
[ $overflow, $notifications, $userPage, $userInterfacePreferences ],
|
||||
static function ( $carry, $list ) {
|
||||
return count( $list ) + $carry;
|
||||
},
|
||||
0
|
||||
),
|
||||
'is-wide' => array_filter(
|
||||
[ $overflow, $notifications, $userPage, $userInterfacePreferences ]
|
||||
) !== [],
|
||||
'data-user-links-notifications' => $notificationsMenu->getTemplateData(),
|
||||
'data-user-links-overflow' => $overflowMenu->getTemplateData(),
|
||||
'data-user-links-preferences' => $preferencesMenu->getTemplateData(),
|
||||
|
|
Loading…
Reference in a new issue