Passed
Pull Request — master (#232)
by Pascal
03:52
created

BuildsCommandsWithHttpHeaders::buildCommand()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 15
rs 9.9666
1
<?php
2
3
namespace ProtoneMedia\LaravelFFMpeg\FFMpeg;
4
5
use FFMpeg\Format\FormatInterface;
6
use Illuminate\Support\Collection;
7
8
trait BuildsCommandsWithHttpHeaders
9
{
10
    use InteractsWithHttpHeaders;
11
12
    protected function buildCommand(FormatInterface $format, $outputPathfile)
13
    {
14
        $command = parent::buildCommand($format, $outputPathfile);
15
16
        if (empty($this->headers)) {
17
            return $command;
18
        }
19
20
        return Collection::make($command)->map(function ($command, $pass) {
0 ignored issues
show
Unused Code introduced by
The parameter $pass is not used and could be removed. ( Ignorable by Annotation )

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

20
        return Collection::make($command)->map(function ($command, /** @scrutinizer ignore-unused */ $pass) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
            return static::mergeBeforePathInput(
22
                $command,
23
                $this->getPathfile(),
0 ignored issues
show
Bug introduced by
It seems like getPathfile() 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

23
                $this->/** @scrutinizer ignore-call */ 
24
                       getPathfile(),
Loading history...
24
                static::compileHeaders($this->headers)
25
            );
26
        })->all();
27
    }
28
}
29