| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function validate(ResponseInterface $response) |
||
| 27 | { |
||
| 28 | if ($response instanceof DurationAwareResponse) { |
||
| 29 | if ($response->getDuration() > $this->maxDuration) { |
||
| 30 | return new CheckResult( |
||
| 31 | CheckResult::STATUS_FAILURE, |
||
| 32 | 'The http request took ' . (int)$response->getDuration() . ' milliseconds (limit was ' . $this->maxDuration . 'ms).', |
||
| 33 | (int)$response->getDuration()); |
||
| 34 | } |
||
| 35 | |||
| 36 | return new CheckResult( |
||
| 37 | CheckResult::STATUS_SUCCESS, |
||
| 38 | 'The http request took ' . (int)$response->getDuration() . ' milliseconds (limit was ' . $this->maxDuration . 'ms).', |
||
| 39 | (int)$response->getDuration()); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |