Completed
Push — master ( 75c543...b51150 )
by max
02:14
created

ConfigFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 13 2
1
<?php
2
3
namespace T4web\Cron;
4
5
use Zend\ServiceManager\ServiceLocatorInterface;
6
use Zend\ServiceManager\FactoryInterface;
7
use Cron\Cron;
8
use T4web\Cron\Resolver\ArrayResolver;
9
use T4web\Cron\Executor\Executor;
10
use T4web\Cron\Config;
11
12
class ConfigFactory implements FactoryInterface
13
{
14
    /**
15
     * Create service
16
     *
17
     * @param ServiceLocatorInterface $serviceLocator
18
     * @return Config
19
     */
20
    public function createService(ServiceLocatorInterface $serviceLocator)
21
    {
22
        $appConfig = $serviceLocator->get('Config');
23
        $config = [];
24
        if (isset($appConfig['cron'])) {
25
            $config = $appConfig['cron'];
26
        }
27
28
        return new Config(
29
            $config,
30
            new FileSystem()
31
        );
32
    }
33
}
34