StreamFilter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilter() 0 3 1
A getPriority() 0 3 1
A __construct() 0 3 1
A apply() 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\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
}