| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.072 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | 1 | protected function setValue(ImmutableDecimal $numerator, ImmutableDecimal $denominator) |
|
| 11 | { |
||
| 12 | |||
| 13 | 1 | if ($numerator->isImaginary() xor $denominator->isImaginary()) { |
|
| 14 | $this->imaginary = true; |
||
| 15 | } else { |
||
| 16 | 1 | $this->imaginary = false; |
|
| 17 | } |
||
| 18 | |||
| 19 | 1 | $this->value = [ |
|
| 20 | 1 | $numerator, |
|
| 21 | 1 | $denominator |
|
| 22 | ]; |
||
| 23 | |||
| 24 | 1 | if ($numerator->isNegative() xor $denominator->isNegative()) { |
|
| 25 | $this->sign = true; |
||
| 26 | } |
||
| 27 | |||
| 28 | 1 | return $this; |
|
| 29 | |||
| 32 | } |