Passed
Push — master ( c16b3d...220de3 )
by Amin
04:06
created

StreamToFile::getPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 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
13
namespace Streaming;
14
15
16
use Streaming\Exception\InvalidArgumentException;
17
use Streaming\Filters\Filter;
18
use Streaming\Filters\StreamToFileFilter;
19
20
class StreamToFile extends Export
21
{
22
23
    /**
24
     * @return string
25
     */
26
    protected function getPath(): string
27
    {
28
        return implode(".", [$this->getFilePath(), $this->path_info["extension"] ?? "mp4"]);
29
    }
30
31
    /**
32
     * @return Filter
33
     */
34
    protected function getFilter(): Filter
35
    {
36
        if ($this->uri) {
37
            throw new InvalidArgumentException("It is not possible to live this file");
38
        }
39
40
        return new StreamToFileFilter($this);
41
    }
42
}