CreatesMercureDrivers
trait CreatesMercureDrivers (View source)
Methods
Create an instance of the driver.
Get a Mercure hub instance for the given configuration.
Get a Mercure hub instance backed by FrankenPHP's built-in hub.
Determine if the given event only targets Mercure connections publishing synchronously.
Get the subscriber token (and cookie) lifetime in whole seconds.
Get the subscriber token factory for the given Mercure configuration.
Get the end-to-end channel encrypter for the given Mercure configuration.
Get the additional JWT claims for the publisher side of the given Mercure configuration.
Get the JWT secret for the given side ("subscribe" or "publish") of the given Mercure configuration.
Get the additional JWT claims for the given Mercure configuration.
Details
protected Broadcaster
createMercureDriver(array $config)
Create an instance of the driver.
HubInterface
mercure(array $config)
Get a Mercure hub instance for the given configuration.
protected HubInterface
frankenPhpMercure(array $config)
Get a Mercure hub instance backed by FrankenPHP's built-in hub.
protected bool
broadcastsToSynchronousMercureConnections(mixed $event)
Determine if the given event only targets Mercure connections publishing synchronously.
protected int
mercureSubscribeExpiration(array $config)
Get the subscriber token (and cookie) lifetime in whole seconds.
protected TokenFactoryInterface|null
mercureSubscribeFactory(array $config)
Get the subscriber token factory for the given Mercure configuration.
protected ChannelEncrypter|null
mercureChannelEncrypter(array $config)
Get the end-to-end channel encrypter for the given Mercure configuration.
protected array
mercurePublishClaims(array $config)
Get the additional JWT claims for the publisher side of the given Mercure configuration.
protected string
mercureSecret(array $config, string $side)
Get the JWT secret for the given side ("subscribe" or "publish") of the given Mercure configuration.
protected array
mercureClaims(array $config)
Get the additional JWT claims for the given Mercure configuration.