public function validate(Response $response) { if ($response->getDuration() > $this->maxDuration) { throw new ValidationFailedException('the http request lasted ' . $response->getDuration() . ' milliseconds.'); } }