ImageResizerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 13
ccs 0
cts 3
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ecodev\Felix\Service;
6
7
use Imagine\Image\ImagineInterface;
8
use Laminas\ServiceManager\Factory\FactoryInterface;
9
use Psr\Container\ContainerInterface;
10
11
final class ImageResizerFactory implements FactoryInterface
12
{
13
    /**
14
     * Return the image service to be used to resize images.
15
     *
16
     * @param string $requestedName
17
     */
18
    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): ImageResizer
19
    {
20
        /** @var ImagineInterface $imagine */
21
        $imagine = $container->get(ImagineInterface::class);
22
23
        return new ImageResizer($imagine);
24
    }
25
}
26