sidebarData = $sidebarData; $user = $skin->getUser(); if ( $user->isRegistered() ) { $this->optOut = new VectorComponentMainMenuActionOptOut( $skin ); } if ( $shouldLanguageAlertBeInSidebar ) { $this->alert = new VectorComponentMainMenuActionLanguageSwitchAlert( $skin ); } } /** * @inheritDoc */ public function getTemplateData(): array { $action = $this->optOut; $alert = $this->alert; return $this->sidebarData + [ 'data-main-menu-action' => $action ? $action->getTemplateData() : null, // T295555 Add language switch alert message temporarily (to be removed). 'data-vector-language-switch-alert' => $alert ? $alert->getTemplateData() : null, ]; } }