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

Filter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A apply() 0 3 1
A getFilter() 0 3 1
A getPriority() 0 3 1
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\Filters;
13
14
use Streaming\Export;
15
use FFMpeg\Filters\FilterInterface;
16
17
abstract class Filter implements FilterInterface, FilterStreamingInterface
18
{
19
    private $priority = 2;
20
21
    protected $filter = [];
22
23
    /**
24
     * Filter constructor.
25
     * @param Export $media
26
     */
27
    public function __construct(Export $media)
28
    {
29
        $this->setFilter($media);
30
    }
31
32
    /**
33
     * Applies the filter on the the Audio media given an format.
34
     *
35
     * @return array An array of arguments
36
     */
37
    public function apply(): array
38
    {
39
        return $this->getFilter();
40
    }
41
42
    /**
43
     * Returns the priority of the filter.
44
     *
45
     * @return integer
46
     */
47
    public function getPriority(): int
48
    {
49
        return $this->priority;
50
    }
51
52
    /**
53
     * @return array
54
     */
55
    public function getFilter(): array
56
    {
57
        return $this->filter;
58
    }
59
}