public function getDomain() { return $this->domain; }
/** * Solve a challenge * * @throws \Exception */ public function solveChallenge() { if (empty($this->solvableChallenges)) { $this->solvableChallenges(); } $domains = array_merge((array) $this->domain->getDomain(), $this->subdomains); foreach ($domains as $domain) { $challenge = $this->challenges[$domain][reset($this->solvableChallenges[$domain])]; if ($challenge->solvable()) { $challenge->solve(); } else { throw new \Exception('Defined unsolvable challenge for ' . $domain); } } }