| Conditions | 5 |
| Paths | 9 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function validate(ResponseInterface $response) |
||
| 13 | { |
||
| 14 | /** @var ContentTypeAwareResponse $response */ |
||
| 15 | |||
| 16 | if (count($this->contentTypes) > 0) { |
||
| 17 | $valid = false; |
||
| 18 | foreach ($this->contentTypes as $validContentType) { |
||
| 19 | if (strpos(strtolower($response->getContentType()), strtolower($validContentType)) !== false) { |
||
| 20 | $valid = true; |
||
| 21 | break; |
||
| 22 | } |
||
| 23 | } |
||
| 24 | if (!$valid) { |
||
| 25 | return; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | return $this->doValidation($response); |
||
| 30 | } |
||
| 31 | |||
| 46 |