Passed
Push — develop ( 6283c8...f1d504 )
by Daniel
08:54
created

ModuleOptionsFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
dl 0
loc 32
ccs 2
cts 5
cp 0.4
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 2
A createService() 0 7 1
1
<?php
2
/**
3
 * ZfMailer
4
 *
5
 * @author     Daniel Wolkenhauer <[email protected]>
6
 * @copyright  Copyright (c) 1997-2019 Daniel Wolkenhauer
7
 * @link       http://dw-labs.de/zfmailer
8
 * @version    0.1.0
9
 */
10
11
namespace ZfMailer\Options;
12
13
use Interop\Container\ContainerInterface;
14
use Interop\Container\Exception\ContainerException;
15
use Zend\ServiceManager\Factory\FactoryInterface;
16
use Zend\ServiceManager\ServiceLocatorInterface;
17
18
19
/**
20
* ModuleOptions Factory
21
* 
22
* @package ZfMailer
23
* @subpackage Options
24
*/
25
class ModuleOptionsFactory implements FactoryInterface
26
{
27
28
  public function __invoke(ContainerInterface $serviceManager, $requestedName, array $options = null)
29
  {
30
31
    $config = $serviceManager->get('config');
32
33
    return new ModuleOptions(isset($config['ZfMailer']) ? $config['ZfMailer'] : array());
34
35
  }
36
37
  /**
38
   * Create Service Factory
39
   *
40
   * @param ServiceLocatorInterface $serviceLocator
41
   */
42
  // public function createService(ServiceLocatorInterface $serviceLocator)
43
  // {
44
45
  //   $config = $serviceLocator->get('config');
46
    
47
  //   return new ModuleOptions(isset($config['ZfMailer']) ? $config['ZfMailer'] : array());
48
49
  // }
50 1
  public function createService(ServiceLocatorInterface $serviceLocator)
51
  {
52
    /* @var ControllerManager $controllerManager*/
53
    // $serviceManager = $controllerManager->getServiceLocator();
54
55
    // return $this->__invoke($serviceManager, null);
56 1
    return $this->__invoke($serviceLocator, null);
57
  }
58
59
}
60