private function tryClose() { if (parent::isDone()) { return; } if ($this->condition_results) { $step_instance = reset($this->step_instances); if (!$step_instance || $step_instance->isDone()) { $this->done(); } return; } if ($this->elseif_instance && $this->elseif_instance->condition_results) { if (!$this->elseif_instance || $this->elseif_instance->isDone()) { $this->done(); } return; } if ($this->else_instance) { if (!$this->else_instance || $this->else_instance->isDone()) { $this->done(); } return; } }