Passed
Push — master ( 3611f6...1d62ef )
by Chris
08:52
created

ImportExistingTicketsFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace ConferenceTools\Checkin\Cli\Command;
4
5
use Carnage\Cqrs\Persistence\EventStore\EventStoreInterface;
6
use ConferenceTools\Checkin\AntiCorruption\TicketMappingListener;
7
use Interop\Container\ContainerInterface;
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
11
class ImportExistingTicketsFactory implements FactoryInterface
12
{
13
    public function createService(ServiceLocatorInterface $serviceLocator)
14
    {
15
        $serviceLocator = $serviceLocator->getServiceLocator();
0 ignored issues
show
Bug introduced by
The method getServiceLocator() does not exist on Zend\ServiceManager\ServiceLocatorInterface. It seems like you code against a sub-type of Zend\ServiceManager\ServiceLocatorInterface such as Zend\ServiceManager\AbstractPluginManager. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        /** @scrutinizer ignore-call */ 
16
        $serviceLocator = $serviceLocator->getServiceLocator();
Loading history...
16
        return $this($serviceLocator, ImportExistingTickets::class);
17
    }
18
19
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
20
    {
21
        $config = $container->get('Config');
22
        return ImportExistingTickets::build(
23
            $config['domain_event_subscriptions'],
24
            $container->get('EventListenerManager')->get(TicketMappingListener::class),
25
            $container->get(EventStoreInterface::class)
26
        );
27
    }
28
}