Completed
Push — master ( 477c6b...8b3cf8 )
by Sébastien
04:39 queued 01:53
created

FFMpegConfig   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 34
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getProcess() 0 7 2
A __construct() 0 4 1
A getBinary() 0 3 1
A getThreads() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Soluble\MediaTools\Config;
6
7
use Soluble\MediaTools\Process\FFmpegProcess;
8
9
class FFMpegConfig
10
{
11
    /** @var string */
12
    protected $binary;
13
14
    /** @var FFmpegProcess */
15
    protected $process;
16
17
    /** @var int|null */
18
    protected $threads;
19
20 1
    public function __construct(string $binary, ?int $threads = null)
21
    {
22 1
        $this->binary  = $binary;
23 1
        $this->threads = $threads;
24 1
    }
25
26 1
    public function getBinary(): string
27
    {
28 1
        return $this->binary;
29
    }
30
31 1
    public function getThreads(): ?int
32
    {
33 1
        return $this->threads;
34
    }
35
36 1
    public function getProcess(): FFmpegProcess
37
    {
38 1
        if ($this->process === null) {
39 1
            $this->process = new FFmpegProcess($this);
40
        }
41
42 1
        return $this->process;
43
    }
44
}
45