Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
35 | public function htmlForSingleDice(Dice $dice) |
||
36 | { |
||
37 | $name = $dice->name(); |
||
38 | if ($name != "d6" && $name != "d20") { |
||
39 | throw new UnrenderableDiceException("Currently only d6 and d20 can be rendered as html"); |
||
40 | } |
||
41 | $roll = $dice->roll(); |
||
42 | $url = "{$this->urlRoot}/images/poorly-drawn/{$name}/{$roll}.png"; |
||
43 | return '<img src="' . $url . '" />'; |
||
44 | } |
||
45 | } |
||
46 |