Completed
Push — master ( 5c8775...04ea00 )
by Frederik
01:47
created

AggregateTransport::send()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Transport;
5
6
use Genkgo\Mail\MessageInterface;
7
use Genkgo\Mail\TransportInterface;
8
9
/**
10
 * Class AggregateTransport
11
 * @package Genkgo\Mail\Transport
12
 */
13
final class AggregateTransport implements TransportInterface
14
{
15
16
    /**
17
     * @var iterable|TransportInterface[]
18
     */
19
    private $transports;
20
21
    /**
22
     * AggregateTransport constructor.
23
     * @param iterable $transports
24
     */
25 1
    public function __construct(iterable $transports)
26
    {
27 1
        $this->transports = $transports;
28 1
    }
29
30
    /**
31
     * @param MessageInterface $message
32
     * @return void
33
     */
34 1
    public function send(MessageInterface $message): void
35
    {
36 1
        foreach ($this->transports as $transport) {
37 1
            $transport->send($message);
38
        }
39
    }
40
}