Completed
Push — master ( 065cdd...96faaf )
by Alejandro
09:28
created

ImageBuilderFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
1
<?php
2
namespace Shlinkio\Shlink\Common\Image;
3
4
use Interop\Container\ContainerInterface;
5
use Interop\Container\Exception\ContainerException;
6
use mikehaertl\wkhtmlto\Image;
7
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
8
use Zend\ServiceManager\Exception\ServiceNotFoundException;
9
use Zend\ServiceManager\Factory\FactoryInterface;
10
11
class ImageBuilderFactory implements FactoryInterface
12
{
13
    /**
14
     * Create an object
15
     *
16
     * @param  ContainerInterface $container
17
     * @param  string $requestedName
18
     * @param  null|array $options
19
     * @return object
20
     * @throws ServiceNotFoundException if unable to resolve the service.
21
     * @throws ServiceNotCreatedException if an exception is raised when
22
     *     creating a service.
23
     * @throws ContainerException if any other error occurs
24
     */
25
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
26
    {
27
        return new ImageBuilder($container, ['factories' => [
28
            Image::class => ImageFactory::class,
29
        ]]);
30
    }
31
}
32