vendor/symfony/notifier/Channel/AbstractChannel.php line 26

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\Channel;
  11. use Symfony\Component\Messenger\MessageBusInterface;
  12. use Symfony\Component\Notifier\Exception\LogicException;
  13. use Symfony\Component\Notifier\Transport\TransportInterface;
  14. /**
  15.  * @author Fabien Potencier <fabien@symfony.com>
  16.  */
  17. abstract class AbstractChannel implements ChannelInterface
  18. {
  19.     protected $transport;
  20.     protected $bus;
  21.     public function __construct(TransportInterface $transport nullMessageBusInterface $bus null)
  22.     {
  23.         if (null === $transport && null === $bus) {
  24.             throw new LogicException(sprintf('"%s" needs a Transport or a Bus but both cannot be "null".', static::class));
  25.         }
  26.         $this->transport $transport;
  27.         $this->bus $bus;
  28.     }
  29. }