| Conditions | 9 |
| Paths | 4 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function doValidation(ResponseInterface $response) |
||
| 23 | { |
||
| 24 | if ($response instanceof ContentTypeAwareResponse) { |
||
| 25 | if (strpos($response->getContentType(), 'image') === false |
||
| 26 | && strpos($response->getContentType(), 'pdf') === false |
||
| 27 | && strpos($response->getContentType(), 'postscript') === false |
||
| 28 | && strpos($response->getContentType(), 'zip') === false |
||
| 29 | && strlen((string)$response->getBody()) >= $this->minFileSize |
||
| 30 | ) { |
||
| 31 | if (!$response->hasHeader('Content-Encoding') || $response->getHeader('Content-Encoding')[0] !== 'gzip') { |
||
| 32 | throw new ValidationFailedException('gzip compression not active'); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | } |
||
| 38 |