PostponableJobStrategyFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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