1 | <?php |
||
8 | class DecoderProvider implements ContainerAwareInterface |
||
9 | { |
||
10 | use ContainerAwareTrait; |
||
11 | |||
12 | private $decoders; |
||
13 | |||
14 | /** |
||
15 | * Constructor. |
||
16 | * |
||
17 | * @param array $decoders List of key (format) value (service ids) of decoders |
||
18 | */ |
||
19 | 12 | public function __construct(array $decoders) |
|
23 | |||
24 | /** |
||
25 | * Verifies a format is supported. |
||
26 | * |
||
27 | * @param string $format |
||
28 | * |
||
29 | * @return bool |
||
30 | */ |
||
31 | 12 | public function supports($format) |
|
35 | |||
36 | /** |
||
37 | * Provides a docder for a supported format. |
||
38 | * |
||
39 | * @param string $format |
||
40 | * |
||
41 | * @return \Seblegall\ApiValidatorBundle\DecoderInterface |
||
42 | * |
||
43 | * @throws \InvalidArgumentException |
||
44 | */ |
||
45 | 3 | public function getDecoder($format) |
|
55 | } |
||
56 |