Passed
Push — master ( 3ee3fe...b14545 )
by Amin
04:48
created

FFMpeg   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of the PHP-FFmpeg-video-streaming package.
5
 *
6
 * (c) Amin Yazdanpanah <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Streaming;
13
14
use FFMpeg\FFMpeg as BFFMpeg;
15
use FFMpeg\FFProbe;
16
use Psr\Log\LoggerInterface;
17
18
class FFMpeg
19
{
20
    /** @var BFFMpeg */
21
    protected $ffmpeg;
22
23
    /**
24
     * FFMpegInstance constructor.
25
     * @param $ffmpeg
26
     */
27
    public function __construct(BFFMpeg $ffmpeg)
28
    {
29
        $this->ffmpeg = $ffmpeg;
30
    }
31
32
    /**
33
     * @param $path
34
     * @return Media
35
     */
36
    public function open($path): Media
37
    {
38
        return new Media($this->ffmpeg->open($path), $path);
39
    }
40
41
    /**
42
     * @param $method
43
     * @param $parameters
44
     * @return mixed
45
     */
46
    public function __call($method, $parameters)
47
    {
48
        return call_user_func_array([$this->ffmpeg, $method], $parameters);
49
    }
50
51
    /**
52
     * @param array $config
53
     * @param LoggerInterface $logger
54
     * @param FFProbe|null $probe
55
     * @return FFMpeg
56
     */
57
    public static function create($config = array(), LoggerInterface $logger = null, FFProbe $probe = null)
58
    {
59
        return new static(BFFMpeg::create($config, $logger, $probe));
60
    }
61
}
62