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

ImageBuilderFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 3
crap 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