HandlesFrames   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getAccuracy() 0 3 1
A getFrameContents() 0 5 1
A unaccurate() 0 5 1
A accurate() 0 5 1
1
<?php
2
3
namespace ProtoneMedia\LaravelFFMpeg\Exporters;
4
5
trait HandlesFrames
6
{
7
    /**
8
     * @var boolean
9
     */
10
    protected $mustBeAccurate = false;
11
12
    /**
13
     * @var boolean
14
     */
15
    protected $returnFrameContents = false;
16
17
    public function accurate(): self
18
    {
19
        $this->mustBeAccurate = true;
20
21
        return $this;
22
    }
23
24
    public function unaccurate(): self
25
    {
26
        $this->mustBeAccurate = false;
27
28
        return $this;
29
    }
30
31
    public function getAccuracy(): bool
32
    {
33
        return $this->mustBeAccurate;
34
    }
35
36
    public function getFrameContents(): string
37
    {
38
        $this->returnFrameContents = true;
39
40
        return $this->save();
0 ignored issues
show
Bug introduced by
It seems like save() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        return $this->/** @scrutinizer ignore-call */ save();
Loading history...
41
    }
42
}
43