private function requireProcessIsTerminated($functionName) { if (!$this->isTerminated()) { throw new \LogicException(sprintf('Process must be terminated before calling %s.', $functionName)); } }