SmtpTransportFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
A __construct() 0 3 1
1
<?php
2
3
namespace Da\Mailer\Transport;
4
5
use Da\Mailer\Helper\ArrayHelper;
6
7
class SmtpTransportFactory extends AbstractTransportFactory
8
{
9
    /**
10
     * {@inheritdoc}
11 2
     */
12
    public function __construct(array $options)
13 2
    {
14 2
        parent::__construct($options);
15
    }
16
17
    /**
18
     * Creates a SmtpTransport.
19
     *
20
     * @return SmtpTransport the instance created
21 2
     */
22
    public function create()
23 2
    {
24 2
        $host = ArrayHelper::remove($this->options, 'host');
25 2
        $port = ArrayHelper::remove($this->options, 'port');
26
        $options = ArrayHelper::getValue($this->options, 'options', []);
27 2
        return new SmtpTransport($host, $port, $options);
28
    }
29
}
30