Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 58
Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 76 Symfony Profiler
$errorPrefix = sprintf('Unable to determine which channels to use to send the "%s" notification', \get_class($notification));
$error = 'you should either pass channels in the constructor, override its "getChannels()" method';
if (null === $this->policy) {
throw new LogicException(sprintf('%s; %s, or configure a "%s".', $errorPrefix, $error, ChannelPolicy::class));
}
if (!$channels = $this->policy->getChannels($notification->getImportance())) {
throw new LogicException(sprintf('%s; the "%s" returns no channels for importance "%s"; %s.', $errorPrefix, ChannelPolicy::class, $notification->getImportance(), $error));
}
}
foreach ($channels as $channelName) {
$transportName = null;
if (false !== $pos = strpos($channelName, '/')) {
$transportName = substr($channelName, $pos + 1);
$channelName = substr($channelName, 0, $pos);
}
if (null === $channel = $this->getChannel($channelName)) {
throw new LogicException(sprintf('The "%s" channel does not exist.', $channelName));
}
if ($channel instanceof SmsChannel && $recipient instanceof NoRecipient) {
throw new LogicException(sprintf('The "%s" channel needs a Recipient.', $channelName));
}
if (!$channel->supports($notification, $recipient)) {
throw new LogicException(sprintf('The "%s" channel is not supported.', $channelName));
}
yield $channel => $transportName;
}
}
private function getChannel(string $name): ?ChannelInterface
{
if ($this->channels instanceof ContainerInterface) {