Example #1
0
 /**
  * @param string $id
  * @param Error $error
  * @param array|string|integer|float|bool|null $data
  * @return Response
  */
 public static function withError(string $id, Error $error, $data = null)
 {
     $self = new self();
     $self->assertPayload($data, 'data');
     $self->id = $id;
     $self->error = $error;
     $self->data = $data;
     return $self;
 }