You are here

public function AcsfMessageResponse::__construct in Acquia Cloud Site Factory Connector 8

Same name and namespace in other branches
  1. 8.2 src/AcsfMessageResponse.php \Drupal\acsf\AcsfMessageResponse::__construct()

Constructor.

Parameters

string $endpoint: The endpoint on the remote service.

mixed $code: The response code from the remote call.

mixed $body: The body of the response.

File

src/AcsfMessageResponse.php, line 41

Class

AcsfMessageResponse
AcsfMessageResponse.

Namespace

Drupal\acsf

Code

public function __construct($endpoint, $code, $body) {
  if (empty($endpoint) || $code === NULL || $body === NULL) {
    throw new AcsfMessageMalformedResponseException('A response must contain an endpoint, a return code and a response body.');
  }
  $this->endpoint = $endpoint;
  $this->code = $code;
  $this->body = $body;
}