Passed
Push — v3_compat ( 940f5e...ceba9a )
by Mateusz
17:28 queued 13:47
created

MtMailPlugin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 75%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 2
c 4
b 0
f 0
lcom 0
cbo 1
dl 0
loc 14
ccs 6
cts 8
cp 0.75
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 11 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 MtMail\Controller\Plugin\MtMail;
14
use MtMail\Service\Mail;
15
16
class MtMailPlugin
17
{
18 1
    public function __invoke(ContainerInterface $serviceLocator)
19
    {
20 1
        if (!method_exists($serviceLocator, 'configure')) {
21
            $serviceLocator = $serviceLocator->getServiceLocator();
22
        }
23 1
        $service = new MtMail(
24 1
            $serviceLocator->get(Mail::class)
25 1
        );
26
27 1
        return $service;
28
    }
29
}
30