Conditions | 4 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
25 | 3 | public function negotiate(string ...$mediaTypes): MediaTypeHandler |
|
26 | { |
||
27 | 3 | foreach ($mediaTypes as $mediaType) { |
|
28 | 3 | foreach ($this->handlers as $handler) { |
|
29 | 3 | if (in_array($mediaType, $handler->getSupportedMediaTypes())) { |
|
30 | 3 | return $handler; |
|
31 | } |
||
32 | } |
||
33 | } |
||
34 | |||
35 | 1 | throw new NonNegotiableMediaTypeException(implode(', ', $mediaTypes)); |
|
36 | } |
||
69 |