ScalewaySmtpTransport example

if ('scaleway+api' === $scheme || 'scaleway' === $scheme) {
            $host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
            $port = $dsn->getPort();
            $region = $dsn->getOption('region');

            return (new ScalewayApiTransport($projectId$token$region$this->client, $this->dispatcher, $this->logger))
                ->setHost($host)
                ->setPort($port);
        }

        if ('scaleway+smtp' === $scheme || 'scaleway+smtps' === $scheme) {
            return new ScalewaySmtpTransport($projectId$token$this->dispatcher, $this->logger);
        }

        throw new UnsupportedSchemeException($dsn, 'scaleway', $this->getSupportedSchemes());
    }

    protected function getSupportedSchemes(): array
    {
        return ['scaleway', 'scaleway+api', 'scaleway+smtp', 'scaleway+smtps'];
    }
}
new Dsn('scaleway+api', 'default', self::USER, self::PASSWORD, null, ['region' => 'fr-par']),
            new ScalewayApiTransport(self::USER, self::PASSWORD, 'fr-par', new MockHttpClient(), null, $logger),
        ];

        yield [
            new Dsn('scaleway', 'default', self::USER, self::PASSWORD),
            new ScalewayApiTransport(self::USER, self::PASSWORD, null, new MockHttpClient(), null, $logger),
        ];

        yield [
            new Dsn('scaleway+smtp', 'default', self::USER, self::PASSWORD),
            new ScalewaySmtpTransport(self::USER, self::PASSWORD, null, $logger),
        ];

        yield [
            new Dsn('scaleway+smtps', 'default', self::USER, self::PASSWORD),
            new ScalewaySmtpTransport(self::USER, self::PASSWORD, null, $logger),
        ];
    }

    public static function unsupportedSchemeProvider(): iterable
    {
        yield [
            
Home | Imprint | This part of the site doesn't use cookies.