RpcServerControllerFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 1
1
<?php
2
3
namespace RabbitMqModule\Controller\Factory;
4
5
use Interop\Container\ContainerInterface;
6
use Interop\Container\Exception\ContainerException;
7
use RabbitMqModule\Controller\RpcServerController as Controller;
8
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
9
use Zend\ServiceManager\Exception\ServiceNotFoundException;
10
use Zend\ServiceManager\Factory\FactoryInterface;
11
12
/**
13
 * Class RpcServerControllerFactory
14
 *
15
 * @package RabbitMqModule\Controller\Factory
16
 */
17
class RpcServerControllerFactory implements FactoryInterface
18
{
19
    /**
20
     * Create an object
21
     *
22
     * @param  ContainerInterface $container
23
     * @param  string $requestedName
24
     * @param  null|array $options
25
     * @return \RabbitMqModule\Controller\RpcServerController
26
     * @throws ServiceNotFoundException if unable to resolve the service.
27
     * @throws ServiceNotCreatedException if an exception is raised when
28
     *     creating a service.
29
     * @throws ContainerException if any other error occurs
30
     */
31 3
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
32
    {
33 3
        return new Controller($container);
34
    }
35
}
36