custom/plugins/MoorlSignIn/src/Storefront/Subscriber/StorefrontSubscriber.php line 18

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Moorl\SignIn\Storefront\Subscriber;
  3. use Shopware\Core\Framework\Routing\Event\SalesChannelContextResolvedEvent;
  4. use Shopware\Core\Framework\Struct\ArrayEntity;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class StorefrontSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents(): array
  9.     {
  10.         return [
  11.             SalesChannelContextResolvedEvent::class => 'onSalesChannelContextResolvedEvent'
  12.         ];
  13.     }
  14.     public function onSalesChannelContextResolvedEvent(SalesChannelContextResolvedEvent $event): void
  15.     {
  16.         $event->getSalesChannelContext()->addExtension('moorlSignIn', new ArrayEntity(['providers' => [
  17.             'facebook' => ['icon' => 'fab|facebook-f''label' => 'moorl-sign-in.loginFacebook'],
  18.             'google' => ['icon' => 'fab|google''label' => 'moorl-sign-in.loginGoogle'],
  19.             'amazon' => ['icon' => 'fab|amazon''label' => 'moorl-sign-in.loginAmazon'],
  20.             'apple' => ['icon' => 'fab|apple''label' => 'moorl-sign-in.loginApple'],
  21.             'microsoft' => ['icon' => 'fab|microsoft''label' => 'moorl-sign-in.loginMicrosoft'],
  22.             'azure' => ['icon' => 'fab|microsoft''label' => 'moorl-sign-in.loginAzure'],
  23.             'discord' => ['icon' => 'fab|discord''label' => 'moorl-sign-in.loginDiscord'],
  24.             'paypal' => ['icon' => 'fab|paypal''label' => 'moorl-sign-in.loginPaypal'],
  25.             'keycloak' => ['icon' => 'fab|shopware''label' => 'moorl-sign-in.loginKeycloak'],
  26.             'generic' => ['icon' => 'fab|shopware''label' => 'moorl-sign-in.loginGeneric']
  27.         ]]));
  28.     }
  29. }