Completed
Push — master ( 359fe7...152344 )
by Sébastien
03:49
created

MediaToolsService   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
wmc 5
eloc 13
dl 0
loc 44
ccs 6
cts 14
cp 0.4286
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getThumbGenerator() 0 3 1
A getAnalyzer() 0 3 1
A __construct() 0 10 1
A getConverter() 0 3 1
A getReader() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @see       https://github.com/soluble-io/soluble-mediatools-cli for the canonical repository
7
 *
8
 * @copyright Copyright (c) 2018-2019 Sébastien Vanvelthem. (https://github.com/belgattitude)
9
 * @license   https://github.com/soluble-io/soluble-mediatools-cli/blob/master/LICENSE.md MIT
10
 */
11
12
namespace Soluble\MediaTools\Cli\Service;
13
14
use Soluble\MediaTools\Video\VideoAnalyzerInterface;
15
use Soluble\MediaTools\Video\VideoConverterInterface;
16
use Soluble\MediaTools\Video\VideoInfoReaderInterface;
17
use Soluble\MediaTools\Video\VideoThumbGeneratorInterface;
18
19
class MediaToolsService implements MediaToolsServiceInterface
20
{
21
    /** @var VideoInfoReaderInterface */
22
    private $reader;
23
24
    /** @var VideoConverterInterface */
25
    private $converter;
26
27
    /** @var VideoAnalyzerInterface */
28
    private $analyzer;
29
30
    /** @var VideoThumbGeneratorInterface */
31
    private $thumbGenerator;
32
33 2
    public function __construct(
34
        VideoInfoReaderInterface $reader,
35
        VideoConverterInterface $converter,
36
        VideoThumbGeneratorInterface $thumbGenerator,
37
        VideoAnalyzerInterface $analyzer
38
    ) {
39 2
        $this->converter      = $converter;
40 2
        $this->reader         = $reader;
41 2
        $this->analyzer       = $analyzer;
42 2
        $this->thumbGenerator = $thumbGenerator;
43 2
    }
44
45
    public function getReader(): VideoInfoReaderInterface
46
    {
47
        return $this->reader;
48
    }
49
50
    public function getAnalyzer(): VideoAnalyzerInterface
51
    {
52
        return $this->analyzer;
53
    }
54
55
    public function getConverter(): VideoConverterInterface
56
    {
57
        return $this->converter;
58
    }
59
60
    public function getThumbGenerator(): VideoThumbGeneratorInterface
61
    {
62
        return $this->thumbGenerator;
63
    }
64
}
65