1 | <?php |
||
15 | class SwiftmailerChannel implements ChannelInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var Swift_Mailer |
||
19 | */ |
||
20 | private $mailer; |
||
21 | |||
22 | /** |
||
23 | * @var SwiftMessageConfiguratorInterface |
||
24 | */ |
||
25 | private $configurator; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $defaults; |
||
31 | |||
32 | /** |
||
33 | * @param Swift_Mailer $mailer |
||
34 | * @param SwiftMessageConfiguratorInterface $configurator |
||
35 | * @param array $defaults |
||
36 | */ |
||
37 | 9 | public function __construct( |
|
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | 6 | public function supports($recipient) |
|
51 | { |
||
52 | 6 | if (is_object($recipient)) { |
|
53 | 4 | return $recipient instanceof EmailRecipientInterface; |
|
54 | } |
||
55 | |||
56 | 2 | if (is_string($recipient)) { |
|
57 | 2 | return false !== filter_var($recipient, FILTER_VALIDATE_EMAIL); |
|
58 | } |
||
59 | |||
60 | return false; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | 1 | public function configure(OptionsResolver $resolver) |
|
78 | |||
79 | /** |
||
80 | * @inheritdoc |
||
81 | */ |
||
82 | 2 | public function handle(Delivery $delivery) |
|
90 | } |
||
91 |