1 | <?php |
||
18 | final class ResponseModeManager |
||
19 | { |
||
20 | /** |
||
21 | * @var ResponseModeInterface[] |
||
22 | */ |
||
23 | private $responseModes = []; |
||
24 | |||
25 | /** |
||
26 | * @return string[] |
||
27 | */ |
||
28 | public function all(): array |
||
29 | { |
||
30 | return array_keys($this->responseModes); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param ResponseModeInterface $responseMode |
||
35 | * |
||
36 | * @return ResponseModeManager |
||
37 | */ |
||
38 | public function add(ResponseModeInterface $responseMode) |
||
44 | |||
45 | /** |
||
46 | * @param string $name |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function has(string $name): bool |
||
54 | |||
55 | /** |
||
56 | * @param string $name |
||
57 | * |
||
58 | * @throws \InvalidArgumentException |
||
59 | * |
||
60 | * @return ResponseModeInterface |
||
61 | */ |
||
62 | public function get(string $name): ResponseModeInterface |
||
68 | |||
69 | /** |
||
70 | * @return string[] |
||
71 | */ |
||
72 | public function list(): array |
||
76 | } |
||
77 |