ChainMessageConfigurator::configure()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 6
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