RouteFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 26
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createService() 0 4 1
A setCreationOptions() 0 4 1
1
<?php
2
namespace SvImages\Router\Factory;
3
4
use SvImages\Router\ImageRoute;
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\MutableCreationOptionsInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
/**
10
 * @author Vytautas Stankus <[email protected]>
11
 * @license MIT
12
 */
13
class RouteFactory implements FactoryInterface, MutableCreationOptionsInterface
14
{
15
    /**
16
     * Options to use when creating an instance
17
     *
18
     * @var array
19
     */
20
    protected $creationOptions = [];
21
22
    public function createService(ServiceLocatorInterface $serviceLocator, $cName = null, $rName = null)
23
    {
24
        return new ImageRoute($this->creationOptions);
25
    }
26
27
    /**
28
     * Set creation options
29
     *
30
     * @param  array $options
31
     *
32
     * @return void
33
     */
34
    public function setCreationOptions(array $options)
35
    {
36
        $this->creationOptions = $options;
37
    }
38
}
39