Passed
Push — master ( 67f2c8...68e9c9 )
by Amin
01:53
created

Filter   A

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 apply() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * Copyright 2019 Amin Yazdanpanah<http://www.aminyazdanpanah.com>.
5
 *
6
 * Licensed under the MIT License;
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *      https://opensource.org/licenses/MIT
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace AYazdanpanah\FFMpegStreaming\Filters;
20
21
use AYazdanpanah\FFMpegStreaming\Export;
22
use FFMpeg\Filters\FilterInterface;
23
24
abstract class Filter implements FilterInterface, FilterStreamingInterface
25
{
26
    private $priority = 2;
27
28
    protected $filter = [];
29
30
    /**
31
     * Filter constructor.
32
     * @param Export $media
33
     */
34
    public function __construct(Export $media)
35
    {
36
        $this->setFilter($media);
37
    }
38
39
    /**
40
     * Applies the filter on the the Audio media given an format.
41
     *
42
     * @return array An array of arguments
43
     */
44
    public function apply(): array
45
    {
46
        return $this->getFilter();
47
    }
48
49
    /**
50
     * Returns the priority of the filter.
51
     *
52
     * @return integer
53
     */
54
    public function getPriority(): int
55
    {
56
        return $this->priority;
57
    }
58
59
    /**
60
     * @return array
61
     */
62
    public function getFilter(): array
63
    {
64
        return $this->filter;
65
    }
66
}