mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 07:43:47 +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 [
|
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(),
|
||||||
|
|
Loading…
Reference in a new issue