Completed
Push — master ( b53e51...1009f9 )
by Alejandro
04:13 queued 38s
created

__invoke()   A

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
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Shlinkio\Shlink\Common\Factory;
3
4
use Interop\Container\ContainerInterface;
5
use Interop\Container\Exception\ContainerException;
6
use Zend\Diactoros\Response\EmptyResponse;
7
use Zend\Expressive\Middleware\ImplicitOptionsMiddleware;
8
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
9
use Zend\ServiceManager\Exception\ServiceNotFoundException;
10
use Zend\ServiceManager\Factory\FactoryInterface;
11
12
class EmptyResponseImplicitOptionsMiddlewareFactory implements FactoryInterface
13
{
14
    /**
15
     * Create an object
16
     *
17
     * @param  ContainerInterface $container
18
     * @param  string $requestedName
19
     * @param  null|array $options
20
     * @return object
21
     * @throws ServiceNotFoundException if unable to resolve the service.
22
     * @throws ServiceNotCreatedException if an exception is raised when
23
     *     creating a service.
24
     * @throws ContainerException if any other error occurs
25
     */
26 2
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
27
    {
28 2
        return new ImplicitOptionsMiddleware(new EmptyResponse());
29
    }
30
}
31