HandlesTimelapse::addTimelapseParametersToFormat()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
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