Failed Conditions
Push — master ( dedbae...8af529 )
by Sébastien
02:19
created

GoogleVod2019Preset   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 29
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getParams() 0 6 1
A getFileExtension() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Soluble\MediaTools\Preset\WebM;
6
7
use Soluble\MediaTools\Preset\PresetInterface;
8
use Soluble\MediaTools\Video\VideoAnalyzerInterface;
9
use Soluble\MediaTools\Video\VideoConverterInterface;
10
use Soluble\MediaTools\Video\VideoConvertParams;
11
use Soluble\MediaTools\Video\VideoInfoReaderInterface;
12
13
class GoogleVod2019Preset implements PresetInterface
14
{
15
    /** @var VideoInfoReaderInterface */
16
    private $reader;
17
18
    /** @var VideoConverterInterface */
19
    private $converter;
20
21
    /** @var VideoAnalyzerInterface */
22
    private $analyzer;
23
24
    public function __construct(VideoInfoReaderInterface $reader, VideoConverterInterface $converter, VideoAnalyzerInterface $analyzer)
25
    {
26
        $this->converter = $converter;
27
        $this->reader    = $reader;
28
        $this->analyzer  = $analyzer;
29
    }
30
31
    public function getParams(string $file, ?int $width = null, ?int $height = null): VideoConvertParams
32
    {
33
        $params = (new VideoConvertParams())
34
            ->withVideoCodec('vp9');
35
36
        return $params;
37
    }
38
39
    public function getFileExtension(): string
40
    {
41
        return 'webm';
42
    }
43
}
44