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

EmptyResponseImplicitOptionsMiddlewareFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
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