HandlesTimelapse   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A asTimelapseWithFramerate() 0 5 1
A addTimelapseParametersToFormat() 0 5 2
1
<?php
2
3
namespace ProtoneMedia\LaravelFFMpeg\Exporters;
4
5
trait HandlesTimelapse
6
{
7
    /**
8
     * @var float
9
     */
10
    protected $timelapseFramerate;
11
12
    public function asTimelapseWithFramerate(float $framerate): self
13
    {
14
        $this->timelapseFramerate = $framerate;
15
16
        return $this;
17
    }
18
19
    protected function addTimelapseParametersToFormat()
20
    {
21
        $this->format->setInitialParameters(array_merge(
22
            $this->format->getInitialParameters() ?: [],
23
            ['-framerate', $this->timelapseFramerate, '-f', 'image2']
24
        ));
25
    }
26
}
27