Skip to content
docsv0.1.0

NotificationChannelRegistry

Registry for notification channels. Allows plugins to register their channels so they can be retrieved dynamically by other services.

NotificationChannelRegistry::register()

public function register(string $name, Milpa\Notifications\Contracts\NotificationChannelInterface $channel): void

Register a notification channel.

Parameters

Parameters of register()
NameTypeDescription
$namestringThe channel name (e.g., 'telegram', 'pushover')
$channelNotificationChannelInterfaceThe channel instance

NotificationChannelRegistry::get()

public function get(string $name): ?Milpa\Notifications\Contracts\NotificationChannelInterface

Get a registered channel by name.

Parameters

Parameters of get()
NameTypeDescription
$namestring

NotificationChannelRegistry::has()

public function has(string $name): bool

Check if a channel is registered.

Parameters

Parameters of has()
NameTypeDescription
$namestring

NotificationChannelRegistry::getAll()

public function getAll(): array

Get all registered channels.