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

vendor/symfony/sendinblue-mailer/Transport/SendinblueTransportFactory.php line 24

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\Mailer\Bridge\Sendinblue\Transport;
  11. use Symfony\Component\Mailer\Exception\UnsupportedSchemeException;
  12. use Symfony\Component\Mailer\Transport\AbstractTransportFactory;
  13. use Symfony\Component\Mailer\Transport\Dsn;
  14. use Symfony\Component\Mailer\Transport\TransportInterface;
  15. /**
  16.  * @author Yann LUCAS
  17.  */
  18. final class SendinblueTransportFactory extends AbstractTransportFactory
  19. {
  20.     public function create(Dsn $dsn): TransportInterface
  21.     {
  22.         if (!\in_array($dsn->getScheme(), $this->getSupportedSchemes(), true)) {
  23.             throw new UnsupportedSchemeException($dsn'sendinblue'$this->getSupportedSchemes());
  24.         }
  25.         switch ($dsn->getScheme()) {
  26.             default:
  27.             case 'sendinblue':
  28.             case 'sendinblue+smtp':
  29.                 $transport SendinblueSmtpTransport::class;
  30.                 break;
  31.             case 'sendinblue+api':
  32.                 return (new SendinblueApiTransport($this->getUser($dsn), $this->client$this->dispatcher$this->logger))
  33.                     ->setHost('default' === $dsn->getHost() ? null $dsn->getHost())
  34.                     ->setPort($dsn->getPort())
  35.                 ;
  36.         }
  37.         return new $transport($this->getUser($dsn), $this->getPassword($dsn), $this->dispatcher$this->logger);
  38.     }
  39.     protected function getSupportedSchemes(): array
  40.     {
  41.         return ['sendinblue''sendinblue+smtp''sendinblue+api'];
  42.     }
  43. }