Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function buildDice(string $type, int $number) : array |
||
23 | { |
||
24 | $newDice = []; |
||
25 | if ((strlen($type) > 4) || ($type > 9000)) { |
||
26 | throw new UncreatableDiceException("Only dice with a power level less than 9000 can be created."); |
||
27 | } |
||
28 | for ($i = 0; $i < $number; $i++) { |
||
29 | $newDice[] = $this->newDiceOfSize($type); |
||
30 | } |
||
31 | return $newDice; |
||
32 | } |
||
33 | |||
46 |