AmqpFactory.php 945 B

123456789101112131415161718192021222324252627282930313233343536
  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\Amqp\Transport;
  11. class AmqpFactory
  12. {
  13. public function createConnection(array $credentials): \AMQPConnection
  14. {
  15. return new \AMQPConnection($credentials);
  16. }
  17. public function createChannel(\AMQPConnection $connection): \AMQPChannel
  18. {
  19. return new \AMQPChannel($connection);
  20. }
  21. public function createQueue(\AMQPChannel $channel): \AMQPQueue
  22. {
  23. return new \AMQPQueue($channel);
  24. }
  25. public function createExchange(\AMQPChannel $channel): \AMQPExchange
  26. {
  27. return new \AMQPExchange($channel);
  28. }
  29. }
  30. class_alias(AmqpFactory::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory::class);