| Total Complexity | 7 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 90.91% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class MapperContext |
||
| 15 | { |
||
| 16 | |||
| 17 | /** @var array<string, IMapper> */ |
||
| 18 | protected array $services = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Add mapper |
||
| 22 | */ |
||
| 23 | public function addMapper(?string $contentType, IMapper $mapper): void |
||
| 26 | 1 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Get mapper |
||
| 30 | * @param string $contentType in format mimeType[; charset=utf8] |
||
| 31 | * @throws InvalidStateException |
||
| 32 | * @return IMapper |
||
| 33 | * |
||
| 34 | */ |
||
| 35 | public function getMapper(?string $contentType): IMapper |
||
| 43 | } |
||
| 44 | |||
| 45 | protected function safeContentType(?string $contentType): string |
||
| 54 |