Conditions | 4 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 40 | public function matches($acceptHeader, array $acceptedContentTypes) |
|
28 | { |
||
29 | 40 | if (empty($acceptHeader)) { |
|
30 | 4 | return false; |
|
31 | } |
||
32 | |||
33 | // This is in case the submitted header is not standards compliant |
||
34 | 36 | if (strpos($acceptHeader, ';')) { |
|
35 | 4 | list($acceptHeader, ) = explode(';', $acceptHeader); |
|
36 | 4 | } |
|
37 | |||
38 | 36 | $format = $this->negotiator->getBest($acceptHeader, $acceptedContentTypes); |
|
39 | |||
40 | 36 | if ($format) { |
|
41 | 32 | return true; |
|
42 | } |
||
43 | |||
44 | 4 | return false; |
|
45 | } |
||
46 | } |
||
47 |