| Conditions | 5 |
| Paths | 5 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function validate(Response $response) |
||
| 22 | { |
||
| 23 | if ($response->getStatus() <= $this->maxStatusCode) { |
||
| 24 | if ($response->hasHeader('Expires')) { |
||
| 25 | $expireRaw = preg_replace('/[^A-Za-z0-9\-\/,]/', '', $response->getHeader('Expires')[0]); |
||
| 26 | if ($expireRaw !== '') { |
||
| 27 | $expires = strtotime($response->getHeader('Expires')[0]); |
||
| 28 | if ($expires < time()) { |
||
| 29 | throw new ValidationFailedException('expires in the past'); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 |