ChainMessageConfigurator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 25
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A configure() 0 6 2
1
<?php
2
3
namespace Yokai\MessengerBundle\Channel\Swiftmailer\Configurator;
4
5
use Swift_Message;
6
use Yokai\MessengerBundle\Delivery;
7
8
/**
9
 * @author Yann Eugoné <[email protected]>
10
 */
11
class ChainMessageConfigurator implements SwiftMessageConfiguratorInterface
12
{
13
    /**
14
     * @var SwiftMessageConfiguratorInterface[]
15
     */
16
    private $configurators;
17
18
    /**
19
     * @param SwiftMessageConfiguratorInterface[] $configurators
20
     */
21
    public function __construct($configurators)
22
    {
23
        $this->configurators = $configurators ?: [];
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function configure(Swift_Message $message, Delivery $delivery)
30
    {
31
        foreach ($this->configurators as $configurator) {
32
            $configurator->configure($message, $delivery);
33
        }
34
    }
35
}
36