Completed
Pull Request — master (#9)
by Vytautas
09:25
created

RouteFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
1
<?php
2
namespace SvImages\Router\Factory;
3
4
use Interop\Container\ContainerInterface;
5
use SvImages\Router\ImageRoute;
6
use Zend\ServiceManager\Factory\FactoryInterface;
7
8
/**
9
 * @author Vytautas Stankus <[email protected]>
10
 * @license MIT
11
 */
12
class RouteFactory implements FactoryInterface
13
{
14
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
15
    {
16
        return new ImageRoute($options);
0 ignored issues
show
Bug introduced by
It seems like $options defined by parameter $options on line 14 can also be of type null; however, SvImages\Router\ImageRoute::__construct() does only seem to accept array, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
17
    }
18
}
19