Passed
Push — master ( 645913...ffdc3b )
by Chris
03:41
created

ImportPurchase::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 6
rs 9.4285
1
<?php
2
3
namespace ConferenceTools\Checkin\Service\Factory\ProcessManager;
4
5
use ConferenceTools\Checkin\Domain\Process\ImportPurchase as ImportPurchaseProcess;
6
use ConferenceTools\Checkin\Domain\ProcessManager\ImportPurchase as ImportPurchaseProcessManager;
7
use Interop\Container\ContainerInterface;
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
use Carnage\Cqrs\Persistence\Repository\PluginManager;
11
12
class ImportPurchase implements FactoryInterface
13
{
14
    public function createService(ServiceLocatorInterface $serviceLocator, $cName = null, $rName = null)
15
    {
16
        return $this($serviceLocator->getServiceLocator(), $rName);
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

16
        return $this($serviceLocator->/** @scrutinizer ignore-call */ getServiceLocator(), $rName);
Loading history...
17
    }
18
19
    public function __invoke(ContainerInterface $container, $name, $options = [])
20
    {
21
        $repositoryManager = $container->get(PluginManager::class);
22
23
        return new ImportPurchaseProcessManager(
24
            $repositoryManager->get(ImportPurchaseProcess::class)
25
        );
26
    }
27
}