InterventionImageManager::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

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 9
ccs 0
cts 7
cp 0
rs 9.6666
cc 1
eloc 4
nc 1
nop 1
crap 2
1
<?php
2
3
namespace SvImages\ImageManager;
4
5
use Intervention\Image\ImageManager;
6
use SvImages\Options\ModuleOptions;
7
use Zend\ServiceManager\FactoryInterface;
8
use Zend\ServiceManager\ServiceLocatorInterface;
9
10
/**
11
 * @author Vytautas Stankus <[email protected]>
12
 * @license MIT
13
 */
14
class InterventionImageManager implements FactoryInterface
15
{
16
    /**
17
     * Create ImageManager
18
     *
19
     * @param ServiceLocatorInterface $serviceLocator
20
     *
21
     * @return ImageManager
22
     */
23
    public function createService(ServiceLocatorInterface $serviceLocator)
24
    {
25
        /** @var ModuleOptions $options */
26
        $options = $serviceLocator->get(ModuleOptions::class);
27
28
        return new ImageManager([
29
            'driver' => $options->getDriver()
30
        ]);
31
    }
32
}
33