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

FileTransportFactory::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

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