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

ImageControllerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 2
1
<?php
2
3
namespace SvImages\Controller\Factory;
4
5
use Psr\Container\ContainerInterface;
6
use SvImages\Controller\ImageController;
7
use SvImages\Options\ModuleOptions;
8
use SvImages\Service\CacheManager;
9
use SvImages\Service\ImageService;
10
11
/**
12
 * @author Vytautas Stankus <[email protected]>
13
 * @license MIT
14
 */
15
class ImageControllerFactory
16
{
17
    /**
18
     * Create ImageController
19
     *
20
     * @param ContainerInterface $container
21
     *
22
     * @return ImageController
23
     */
24
    public function __invoke(ContainerInterface $container)
25
    {
26
        /** @var ImageService $imageService */
27
        $imageService = $container->get(ImageService::class);
28
        /** @var CacheManager $cacheManager */
29
        $cacheManager = $container->get(CacheManager::class);
30
        /** @var ModuleOptions $options */
31
        $options = $container->get(ModuleOptions::class);
32
33
        return new ImageController($imageService, $cacheManager, $options);
34
    }
35
}
36