vendor/symfony/redis-messenger/Transport/RedisTransportFactory.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\Messenger\Bridge\Redis\Transport;
  11. use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
  12. use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
  13. use Symfony\Component\Messenger\Transport\TransportInterface;
  14. /**
  15.  * @author Alexander Schranz <alexander@suluio>
  16.  * @author Antoine Bluchet <soyuka@gmail.com>
  17.  */
  18. class RedisTransportFactory implements TransportFactoryInterface
  19. {
  20.     public function createTransport(string $dsn, array $optionsSerializerInterface $serializer): TransportInterface
  21.     {
  22.         unset($options['transport_name']);
  23.         return new RedisTransport(Connection::fromDsn($dsn$options), $serializer);
  24.     }
  25.     public function supports(string $dsn, array $options): bool
  26.     {
  27.         return === strpos($dsn'redis://') || === strpos($dsn'rediss://');
  28.     }
  29. }
  30. if (!class_exists(\Symfony\Component\Messenger\Transport\RedisExt\RedisTransportFactory::class, false)) {
  31.     class_alias(RedisTransportFactory::class, \Symfony\Component\Messenger\Transport\RedisExt\RedisTransportFactory::class);
  32. }