custom/plugins/SwagPlatformSecurity/src/Subscriber/TwigStateProvider.php line 16

  1. <?php declare(strict_types=1);
  2. namespace Swag\Security\Subscriber;
  3. use Shopware\Core\Framework\Log\Package;
  4. use Shopware\Storefront\Event\StorefrontRenderEvent;
  5. use Swag\Security\Components\State;
  6. #[Package('services-settings')]
  7. class TwigStateProvider
  8. {
  9.     public function __construct(private readonly State $state)
  10.     {
  11.     }
  12.     public function __invoke(StorefrontRenderEvent $event): void
  13.     {
  14.         $event->setParameter('swagSecurity'$this->state);
  15.     }
  16. }