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

ModuleOptionsFactory::__invoke()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

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