use Symfony\Component\Scheduler\Exception\InvalidArgumentException;
use Symfony\Component\Scheduler\Generator\MessageGenerator;
use Symfony\Component\Scheduler\ScheduleProviderInterface;
/**
* @implements TransportFactoryInterface<SchedulerTransport>
*/
class SchedulerTransportFactory implements TransportFactoryInterface
{ public function __construct( private readonly ContainerInterface
$scheduleProviders,
private readonly ClockInterface
$clock =
new Clock(),
) { } public function createTransport(string
$dsn, array
$options, SerializerInterface
$serializer): SchedulerTransport
{ if ('schedule://' ===
$dsn) { throw new InvalidArgumentException('The Schedule DSN must contains a name, e.g. "schedule://default".'
);
} if (false ===
$scheduleName =
parse_url($dsn, \PHP_URL_HOST
)) { throw new InvalidArgumentException(sprintf('The given Schedule DSN "%s" is invalid.',
$dsn));
}