VideoInfoReaderFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 3
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\Cache\CacheInterface;
16
use Soluble\MediaTools\Video\Config\FFProbeConfigInterface;
17
use Soluble\MediaTools\Video\Logger\LoggerInterface;
18
19
final class VideoInfoReaderFactory
20
{
21 31
    public function __invoke(ContainerInterface $container): VideoInfoReaderInterface
22
    {
23 31
        $logger = $container->has(LoggerInterface::class) ? $container->get(LoggerInterface::class) : null;
24 31
        $cache  = $container->has(CacheInterface::class) ? $container->get(CacheInterface::class) : null;
25
26 31
        return new VideoInfoReader(
27 31
            $container->get(FFProbeConfigInterface::class),
28
            $logger,
29
            $cache
30
        );
31
    }
32
}
33