| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 34 | public static function fromMark($a_mark) |
|
| 24 | { |
||
| 25 | 34 | $roll_type = RollType::fromMark($a_mark); |
|
| 26 | |||
| 27 | 34 | if ($roll_type->isSpare()) { |
|
| 28 | 12 | return new self($a_mark); |
|
| 29 | } |
||
| 30 | |||
| 31 | 34 | if ($roll_type->isStrike()) { |
|
| 32 | 14 | return new self($a_mark, 10); |
|
| 33 | } |
||
| 34 | |||
| 35 | 32 | if ($roll_type->isEmpty()) { |
|
| 36 | 30 | return new self($a_mark, 0); |
|
| 37 | } |
||
| 38 | |||
| 39 | 28 | return new self($a_mark, (int)$a_mark); |
|
| 40 | } |
||
| 41 | |||
| 57 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..