UserFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace LmcUser\Factory\Service;
4
5
use Interop\Container\ContainerInterface;
6
use Laminas\ServiceManager\Factory\FactoryInterface;
7
use Laminas\ServiceManager\ServiceLocatorInterface;
8
use LmcUser\Service\User;
9
10
class UserFactory implements FactoryInterface
11
{
12
    public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
13
    {
14
        $service = new User();
15
        $service->setServiceManager($serviceLocator);
16
17
        return $service;
18
    }
19
20
    /**
21
     * Create service
22
     *
23
     * @param  ServiceLocatorInterface $serviceLocator
24
     * @return mixed
25
     */
26
    public function createService(ServiceLocatorInterface $serviceLocator)
27
    {
28
        return $this->__invoke($serviceLocator, null);
29
    }
30
}
31