mercureact/src/Broker/Subscriber/SubscriberInterface.php

44 lines
981 B
PHP

<?php
namespace NoccyLabs\Mercureact\Broker\Subscriber;
use NoccyLabs\Mercureact\Broker\Message;
interface SubscriberInterface
{
/**
* Deliver a message to the subscriber.
*
* @param Message $message
* @return void
*/
public function deliver(Message $message): void;
/**
* Returns true if the subscriber has athenticated.
*
* @return bool true if the subscriber has provided valid credentials
*/
public function isAuthenticated(): bool;
/**
* Returns the content of the JWT mercure claim if present.
*
* @return array|null
*/
public function getMercureClaims(): ?array;
/**
* Returns the content of the JWT mercure.payload claim if present.
*
* @return array|null
*/
public function getPayload(): ?array;
/**
* Get the unique subscriber ID, in the form 'urn:uuid:...'
*
* @return string
*/
public function getId(): string;
}