public function handleEnd()
{
$this->handleData('');
if ($this->closed) {
return;
}
if ($this->buffer === '' && $this->reachedEnd) {
$this->emit('end');
$this->close();
return;
}
$this->emit('error', [new Exception('Stream ended with incomplete control code')]);
$this->close();
}