Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
43 | 2 | public function transform(string $string, string $contentType): array |
|
44 | { |
||
45 | 2 | if (isset($this->transformers[$contentType])) { |
|
46 | 1 | return $this->transformers[$contentType]->transform($string); |
|
47 | } |
||
48 | |||
49 | 1 | throw new \InvalidArgumentException(sprintf('There is no transformer for content-type: %s', $contentType)); |
|
50 | } |
||
51 | } |
||
52 |