Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class FormatRetriever implements FormatRetrieverInterface |
||
12 | { |
||
13 | private $mapping; |
||
14 | |||
15 | public function __construct(array $mapping = []) |
||
16 | { |
||
17 | $this->mapping = $mapping; |
||
18 | } |
||
19 | /** |
||
20 | * @param string $contentType |
||
21 | * @return string|null |
||
22 | */ |
||
23 | public function getFormat(string $contentType): ?string |
||
24 | { |
||
25 | return $this->mapping[$contentType] ?? null; |
||
26 | } |
||
27 | |||
28 | public function getContentType(string $format): ?string |
||
35 | } |
||
36 | } |
||
37 |