| Conditions | 3 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function getMapper(?string $contentType): IMapper |
||
| 36 | { |
||
| 37 | 1 | $contentType = explode(';', strval($contentType)); |
|
| 38 | 1 | $contentType = $this->safeContentType($contentType[0] ?: null); |
|
| 39 | 1 | if (!isset($this->services[$contentType])) { |
|
| 40 | 1 | throw new InvalidStateException('There is no mapper for Content-Type: ' . $contentType); |
|
| 41 | } |
||
| 42 | 1 | return $this->services[$contentType]; |
|
| 43 | } |
||
| 54 |