Code Duplication    Length = 21-21 lines in 2 locations

src/Controller/Plugin/Factory/LogThrowableFactory.php 1 location

@@ 18-38 (lines=21) @@
15
use Zend\ServiceManager\FactoryInterface;
16
use Zend\ServiceManager\ServiceLocatorInterface;
17
18
final class LogThrowableFactory implements FactoryInterface
19
{
20
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
21
    {
22
        /** @var ThrowableLogger $throwableLogger */
23
        $throwableLogger = $container->get(ThrowableLogger::class);
24
25
        return new LogThrowable($throwableLogger);
26
    }
27
28
    /**
29
     * Create service
30
     *
31
     * @param ServiceLocatorInterface $serviceLocator
32
     * @return mixed
33
     */
34
    public function createService(ServiceLocatorInterface $serviceLocator)
35
    {
36
        return $this($serviceLocator->getServiceLocator(), ThrowableLogger::class);
37
    }
38
}
39

src/View/Helper/Factory/LogThrowableFactory.php 1 location

@@ 18-38 (lines=21) @@
15
use Zend\ServiceManager\FactoryInterface;
16
use Zend\ServiceManager\ServiceLocatorInterface;
17
18
final class LogThrowableFactory implements FactoryInterface
19
{
20
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
21
    {
22
        /** @var ThrowableLogger $throwableLogger */
23
        $throwableLogger = $container->get(ThrowableLogger::class);
24
25
        return new LogThrowable($throwableLogger);
26
    }
27
28
    /**
29
     * Create service
30
     *
31
     * @param ServiceLocatorInterface $serviceLocator
32
     * @return mixed
33
     */
34
    public function createService(ServiceLocatorInterface $serviceLocator)
35
    {
36
        return $this($serviceLocator->getServiceLocator(), ThrowableLogger::class);
37
    }
38
}
39