VideoConverterFactory::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @see       https://github.com/soluble-io/soluble-mediatools for the canonical repository
7
 *
8
 * @copyright Copyright (c) 2018-2020 Sébastien Vanvelthem. (https://github.com/belgattitude)
9
 * @license   https://github.com/soluble-io/soluble-mediatools/blob/master/LICENSE.md MIT
10
 */
11
12
namespace Soluble\MediaTools\Video;
13
14
use Psr\Container\ContainerInterface;
15
use Soluble\MediaTools\Video\Config\FFMpegConfigInterface;
16
use Soluble\MediaTools\Video\Logger\LoggerInterface;
17
18
final class VideoConverterFactory
19
{
20 20
    public function __invoke(ContainerInterface $container): VideoConverterInterface
21
    {
22 20
        $logger = $container->has(LoggerInterface::class) ? $container->get(LoggerInterface::class) : null;
23
24 20
        return new VideoConverter(
25 20
            $container->get(FFMpegConfigInterface::class),
26
            $logger
27
        );
28
    }
29
}
30