1 | <?php |
||
16 | final class CompressionMethodManager |
||
17 | { |
||
18 | /** |
||
19 | * @var CompressionMethodInterface[] |
||
20 | */ |
||
21 | private $compressionMethods = []; |
||
22 | |||
23 | /** |
||
24 | * @param CompressionMethodInterface[] $methods |
||
25 | * |
||
26 | * @return CompressionMethodManager |
||
27 | */ |
||
28 | public static function create(array $methods): CompressionMethodManager |
||
37 | |||
38 | /** |
||
39 | * @param CompressionMethodInterface $compressionMethod |
||
40 | */ |
||
41 | private function add(CompressionMethodInterface $compressionMethod) |
||
50 | |||
51 | /** |
||
52 | * @param string $name |
||
53 | * |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function has(string $name): bool |
||
60 | |||
61 | /** |
||
62 | * This method will try to find a CompressionInterface object able to support the compression method. |
||
63 | * |
||
64 | * @param string $name The name of the compression method |
||
65 | * |
||
66 | * @return CompressionMethodInterface |
||
67 | */ |
||
68 | public function get(string $name): CompressionMethodInterface |
||
76 | |||
77 | /** |
||
78 | * @return string[] |
||
79 | */ |
||
80 | public function list(): array |
||
84 | } |
||
85 |