<?php declare(strict_types=1);
namespace Moorl\SignIn\Storefront\Subscriber;
use Shopware\Core\Framework\Routing\Event\SalesChannelContextResolvedEvent;
use Shopware\Core\Framework\Struct\ArrayEntity;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class StorefrontSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
SalesChannelContextResolvedEvent::class => 'onSalesChannelContextResolvedEvent'
];
}
public function onSalesChannelContextResolvedEvent(SalesChannelContextResolvedEvent $event): void
{
$event->getSalesChannelContext()->addExtension('moorlSignIn', new ArrayEntity(['providers' => [
'facebook' => ['icon' => 'fab|facebook-f', 'label' => 'moorl-sign-in.loginFacebook'],
'google' => ['icon' => 'fab|google', 'label' => 'moorl-sign-in.loginGoogle'],
'amazon' => ['icon' => 'fab|amazon', 'label' => 'moorl-sign-in.loginAmazon'],
'apple' => ['icon' => 'fab|apple', 'label' => 'moorl-sign-in.loginApple'],
'microsoft' => ['icon' => 'fab|microsoft', 'label' => 'moorl-sign-in.loginMicrosoft'],
'azure' => ['icon' => 'fab|microsoft', 'label' => 'moorl-sign-in.loginAzure'],
'discord' => ['icon' => 'fab|discord', 'label' => 'moorl-sign-in.loginDiscord'],
'paypal' => ['icon' => 'fab|paypal', 'label' => 'moorl-sign-in.loginPaypal'],
'keycloak' => ['icon' => 'fab|shopware', 'label' => 'moorl-sign-in.loginKeycloak'],
'generic' => ['icon' => 'fab|shopware', 'label' => 'moorl-sign-in.loginGeneric']
]]));
}
}