ThrowableLoggerFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 20
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
A createService() 0 4 1
1
<?php
2
/**
3
 * Polder Knowledge / log-module (https://polderknowledge.com)
4
 *
5
 * @link https://github.com/polderknowledge/log-module for the canonical source repository
6
 * @copyright Copyright (c) 2016-2017 Polder Knowledge (https://polderknowledge.com)
7
 * @license https://github.com/polderknowledge/log-module/blob/master/LICENSE.md MIT
8
 */
9
10
namespace PolderKnowledge\LogModule\TaskService\Factory;
11
12
use Interop\Container\ContainerInterface;
13
use PolderKnowledge\LogModule\TaskService\ThrowableLogger;
14
use Zend\ServiceManager\FactoryInterface;
15
use Zend\ServiceManager\ServiceLocatorInterface;
16
17
final class ThrowableLoggerFactory implements FactoryInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Zend\ServiceManager\FactoryInterface has been deprecated with message: Use Zend\ServiceManager\Factory\FactoryInterface instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
18
{
19 3
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
20
    {
21 3
        $errorLogger = $container->get('ErrorLogger'); // @todo Should we make this dynamic?
22
23 3
        return new ThrowableLogger($errorLogger);
24
    }
25
26
    /**
27
     * Create service
28
     *
29
     * @param ServiceLocatorInterface $serviceLocator
30
     * @return mixed
31
     */
32
    public function createService(ServiceLocatorInterface $serviceLocator)
33
    {
34
        return $this($serviceLocator, 'ErrorLogger');
35
    }
36
}
37