function __construct(Alert $alert, string $message) { $this->output = null; $this->alert = $alert; $message = $this->alert->toString() . " " . $message; parent::__construct($message, $alert->getDescCode()); }
public function encodeAlert($data) { $core = $this->core; $alert = new Alert(); $alert->encode($data); $this->content = $alert; $core->isClosed = true; if ($alert->getDescCode() != Alert::CLOSE_NOTIFY) { throw new TLSAlertException($alert, "Alert received from peer"); } }