1 | <?php |
||
16 | class CompressionMethodManager |
||
17 | { |
||
18 | /** |
||
19 | * @var CompressionMethod[] |
||
20 | */ |
||
21 | private $compressionMethods = []; |
||
22 | |||
23 | /** |
||
24 | * CompressionMethodManager constructor. |
||
25 | * |
||
26 | * @deprecated Will be private in v2.x. Please use CompressionManager::create() instead. |
||
27 | */ |
||
28 | public function __construct() |
||
31 | |||
32 | /** |
||
33 | * This method creates a Compression Manager with the selected compression methods. |
||
34 | * |
||
35 | * @param CompressionMethod[] $methods |
||
36 | * |
||
37 | * @return CompressionMethodManager |
||
38 | */ |
||
39 | public static function create(array $methods): self |
||
48 | |||
49 | /** |
||
50 | * Add the given compression method to the manager. |
||
51 | * |
||
52 | * @param CompressionMethod $compressionMethod |
||
53 | */ |
||
54 | protected function add(CompressionMethod $compressionMethod) |
||
63 | |||
64 | /** |
||
65 | * Returns true if the givn compression method is supported. |
||
66 | * |
||
67 | * @param string $name |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function has(string $name): bool |
||
75 | |||
76 | /** |
||
77 | * This method returns the compression method with the given name. |
||
78 | * Throws an exception if the method is not supported. |
||
79 | * |
||
80 | * @param string $name The name of the compression method |
||
81 | * |
||
82 | * @return CompressionMethod |
||
83 | */ |
||
84 | public function get(string $name): CompressionMethod |
||
92 | |||
93 | /** |
||
94 | * Returns the list of compression method names supported by the manager. |
||
95 | * |
||
96 | * @return string[] |
||
97 | */ |
||
98 | public function list(): array |
||
102 | } |
||
103 |