AggregateTransport   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 26
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A send() 0 6 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
final class AggregateTransport implements TransportInterface
10
{
11
    /**
12
     * @var iterable|TransportInterface[]
13
     */
14
    private $transports;
15
16
    /**
17
     * @param iterable|TransportInterface[] $transports
18
     */
19 1
    public function __construct(iterable $transports)
20
    {
21 1
        $this->transports = $transports;
22 1
    }
23
24
    /**
25
     * @param MessageInterface $message
26
     * @return void
27
     */
28 1
    public function send(MessageInterface $message): void
29
    {
30 1
        foreach ($this->transports as $transport) {
31 1
            $transport->send($message);
32
        }
33 1
    }
34
}
35