Passed
Pull Request — master (#198)
by Pascal
02:39
created

MediaOpenerFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace ProtoneMedia\LaravelFFMpeg\Support;
4
5
use Illuminate\Support\Traits\ForwardsCalls;
6
use ProtoneMedia\LaravelFFMpeg\Drivers\PHPFFMpeg;
7
use ProtoneMedia\LaravelFFMpeg\MediaOpener;
8
9
class MediaOpenerFactory
10
{
11
    use ForwardsCalls;
12
13
    private $defaultDisk;
14
    private $driver;
15
16
    public function __construct(string $defaultDisk, PHPFFMpeg $driver)
17
    {
18
        $this->defaultDisk = $defaultDisk;
19
        $this->driver      = $driver;
20
    }
21
22
    /**
23
    * Handle dynamic method calls into the MediaOpener.
24
    *
25
    * @param  string  $method
26
    * @param  array  $parameters
27
    * @return mixed
28
    */
29
    public function __call($method, $parameters)
30
    {
31
        return $this->forwardCallTo(
32
            new MediaOpener($this->defaultDisk, $this->driver),
33
            $method,
34
            $parameters
35
        );
36
    }
37
}
38