Completed
Push — master ( 948998...4f0b2f )
by Jaap
13s
created

ThrowableLoggerFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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