PostponableJobStrategyFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createService() 0 7 1
1
<?php
2
3
namespace BsbPostponableJobStrategy\Strategy\Factory;
4
5
use BsbPostponableJobStrategy\Strategy\PostponableJobStrategy;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
/**
10
 * BsbPostponableJobStrategyFactory
11
 */
12
final class PostponableJobStrategyFactory implements FactoryInterface
13
{
14
    protected $options;
15
16 2
    public function __construct(array $options = null)
17
    {
18 2
        $this->options = $options;
19 2
    }
20
21
    /**
22
     * Create service
23
     *
24
     * @param ServiceLocatorInterface $serviceLocator
25
     * @return PostponableJobStrategy
26
     */
27 2
    public function createService(ServiceLocatorInterface $serviceLocator)
28
    {
29 2
        $serviceLocator = $serviceLocator->getServiceLocator();
30 2
        $strategy       = new PostponableJobStrategy($serviceLocator, $this->options);
31
32 2
        return $strategy;
33
    }
34
}
35