RouteFactory::setCreationOptions()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
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