| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 29 | final public function generateValidAnswer($number) |
||
| 30 | { |
||
| 31 | foreach ($this->toArray() as $gameRule) { |
||
| 32 | try { |
||
| 33 | return $gameRule->generateValidAnswer($number); |
||
| 34 | } catch (IrrelevantRuleException $exception) { |
||
| 35 | continue; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | throw new \DomainException('No valid answer can be generated from the current rules set.'); |
||
| 40 | } |
||
| 41 | |||
| 47 |