Completed
Push — master ( 40cd32...2cd668 )
by Pascal
02:13
created

FrameExporter::getAccuracy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Pbmedia\LaravelFFMpeg;
4
5
class FrameExporter extends MediaExporter
6
{
7
    protected $mustBeAccurate = false;
8
9
    protected $saveMethod = 'saveFrame';
10
11
    public function accurate(): MediaExporter
12
    {
13
        $this->mustBeAccurate = true;
14
15
        return $this;
16
    }
17
18
    public function unaccurate(): MediaExporter
19
    {
20
        $this->mustBeAccurate = false;
21
22
        return $this;
23
    }
24
25
    public function getAccuracy(): bool
26
    {
27
        return $this->mustBeAccurate;
28
    }
29
30
    private function saveFrame(string $fullPath): MediaExporter
31
    {
32
        $this->media->save($fullPath, $this->getAccuracy());
0 ignored issues
show
Documentation introduced by
$fullPath is of type string, but the function expects a object<Pbmedia\LaravelFFMpeg\FormatInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
33
34
        return $this;
35
    }
36
}
37