Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
9 | 34 | public function __construct(array $a_roll_content_array) |
|
10 | { |
||
11 | 34 | $roll_array = []; |
|
12 | 34 | foreach ($a_roll_content_array as $key => $roll_content) { |
|
13 | 34 | $roll = Roll::fromMark($roll_content); |
|
14 | |||
15 | 34 | if ($roll->type()->isSpare()) { |
|
16 | 12 | $roll->increaseScore(Frame::MAX_FRAME_SCORE - Roll::fromMark($a_roll_content_array[$key - 1])->score()); |
|
17 | } |
||
18 | |||
19 | 34 | $roll_array[] = $roll; |
|
20 | } |
||
21 | |||
22 | 34 | $this->roll_array = $roll_array; |
|
23 | 34 | } |
|
24 | |||
70 |