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-notifier/SendinblueTransportFactory.php line 27

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\Notifier\Bridge\Sendinblue;
  11. use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
  12. use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
  13. use Symfony\Component\Notifier\Transport\Dsn;
  14. use Symfony\Component\Notifier\Transport\TransportInterface;
  15. /**
  16.  * @author Pierre Tondereau <pierre.tondereau@protonmail.com>
  17.  */
  18. final class SendinblueTransportFactory extends AbstractTransportFactory
  19. {
  20.     /**
  21.      * @return SendinblueTransport
  22.      */
  23.     public function create(Dsn $dsn): TransportInterface
  24.     {
  25.         $scheme $dsn->getScheme();
  26.         if ('sendinblue' !== $scheme) {
  27.             throw new UnsupportedSchemeException($dsn'sendinblue'$this->getSupportedSchemes());
  28.         }
  29.         $apiKey $this->getUser($dsn);
  30.         $sender $dsn->getRequiredOption('sender');
  31.         $host 'default' === $dsn->getHost() ? null $dsn->getHost();
  32.         $port $dsn->getPort();
  33.         return (new SendinblueTransport($apiKey$sender$this->client$this->dispatcher))->setHost($host)->setPort($port);
  34.     }
  35.     protected function getSupportedSchemes(): array
  36.     {
  37.         return ['sendinblue'];
  38.     }
  39. }