Passed
Push — master ( 4bc7af...ac0e9d )
by Amin
02:25
created

StreamFilter::getFilter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\Filters;
13
14
use Streaming\StreamInterface;
15
16
abstract class StreamFilter implements StreamFilterInterface
17
{
18
    private $priority = 2;
19
20
    protected $filter = [];
21
22
    /**
23
     * Filter constructor.
24
     * @param StreamInterface $stream
25
     */
26
    public function __construct(StreamInterface $stream)
27
    {
28
        $this->streamFilter($stream);
29
    }
30
31
    /**
32
     * Applies the filter on the the stream media
33
     *
34
     * @return array An array of arguments
35
     */
36
    public function apply(): array
37
    {
38
        return $this->getFilter();
39
    }
40
41
    /**
42
     * Returns the priority of the filter.
43
     *
44
     * @return integer
45
     */
46
    public function getPriority(): int
47
    {
48
        return $this->priority;
49
    }
50
51
    /**
52
     * @return array
53
     */
54
    public function getFilter(): array
55
    {
56
        return $this->filter;
57
    }
58
}