| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 57 | } |
||
| 58 | } |