function ProcessStream::terminate
Overrides AbstractStream::terminate
File
-
vendor/
symfony/ mailer/ Transport/ Smtp/ Stream/ ProcessStream.php, line 57
Class
- ProcessStream
- A stream supporting local processes.
Namespace
Symfony\Component\Mailer\Transport\Smtp\StreamCode
public function terminate() : void {
if (null !== $this->stream) {
fclose($this->in);
$out = stream_get_contents($this->out);
fclose($this->out);
$err = stream_get_contents($this->err);
fclose($this->err);
if (0 !== ($exitCode = proc_close($this->stream))) {
$errorMessage = 'Process failed with exit code ' . $exitCode . ': ' . $out . $err;
}
}
parent::terminate();
if (!$this->interactive && isset($errorMessage)) {
throw new TransportException($errorMessage);
}
}