Completed
Pull Request — master (#29)
by Mateusz
37:30 queued 34:33
created

FileTransportFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 2
c 6
b 0
f 0
lcom 0
cbo 3
dl 0
loc 13
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 10 2
1
<?php
2
/**
3
 * MtMail - e-mail module for Zend Framework 2
4
 *
5
 * @link      http://github.com/mtymek/MtMail
6
 * @copyright Copyright (c) 2013-2014 Mateusz Tymek
7
 * @license   BSD 2-Clause
8
 */
9
10
namespace MtMail\Factory;
11
12
use Interop\Container\ContainerInterface;
13
use Zend\Mail\Transport\File;
14
use Zend\Mail\Transport\FileOptions;
15
16
class FileTransportFactory
17
{
18
    public function __invoke(ContainerInterface $serviceLocator)
19
    {
20
        $configuration = $serviceLocator->get('Configuration');
21
        $serviceConfig = isset($configuration['mt_mail']['transport_options'])
22
            ? $configuration['mt_mail']['transport_options'] : [];
23
        $options = new FileOptions($serviceConfig);
24
        $file = new File($options);
25 2
26
        return $file;
27 2
    }
28
}
29