Completed
Push — master ( 1fd677...d734d1 )
by Alejandro
27s queued 11s
created

ImageBuilderFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

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

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

30
        return /** @scrutinizer ignore-deprecated */ new ImageBuilder($container, ['factories' => [
Loading history...
31 1
            Image::class => ImageFactory::class,
32
        ]]);
33
    }
34
}
35