public function validate(Response $response, Result $result) { $destination = $response->getDestination(); if (!$this->expectedDestination->equals(new Destination($destination))) { $result->addError(sprintf('Destination in response "%s" does not match the expected destination "%s"', $destination, $this->expectedDestination)); } }
public static function createFromValidationResult(Result $result) { $message = sprintf('Cannot process response, preconditions not met: "%s"', implode('", "', $result->getErrors())); return new self($message); }
public function validate(Response $response, Result $result) { if (!$response->isSuccess()) { $result->addError($this->buildMessage($response->getStatus())); } }