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

ImportPurchase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createService() 0 3 1
A __invoke() 0 6 1
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
}