Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
CRAP
40.00% covered (danger)
40.00%
2 / 5
AbstractChannel
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
4.94
40.00% covered (danger)
40.00%
2 / 5
 __construct
0.00% covered (danger)
0.00%
0 / 1
4.94
40.00% covered (danger)
40.00%
2 / 5
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Notifier\Channel;
13
14use Symfony\Component\Messenger\MessageBusInterface;
15use Symfony\Component\Notifier\Exception\LogicException;
16use Symfony\Component\Notifier\Transport\TransportInterface;
17
18/**
19 * @author Fabien Potencier <fabien@symfony.com>
20 *
21 * @experimental in 5.1
22 */
23abstract class AbstractChannel implements ChannelInterface
24{
25    protected $transport;
26    protected $bus;
27
28    public function __construct(TransportInterface $transport = null, MessageBusInterface $bus = null)
29    {
30        if (null === $transport && null === $bus) {
31            throw new LogicException(sprintf('"%s" needs a Transport or a Bus but both cannot be "null".', static::class));
32        }
33
34        $this->transport = $transport;
35        $this->bus = $bus;
36    }
37}