| Conditions | 5 |
| Paths | 16 |
| Total Lines | 24 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected function setValue(string $value, int $precision = null, int $base = 10) |
||
| 31 | {
|
||
| 32 | $imaginary = false; |
||
| 33 | |||
| 34 | if (strpos($value, 'i') !== false) {
|
||
| 35 | $value = str_replace('i', '', $value);
|
||
| 36 | $imaginary = true; |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($base != 10) {
|
||
| 40 | $value = $this->convertValue($value, 10, $base); |
||
| 41 | } |
||
| 42 | |||
| 43 | if ($imaginary) {
|
||
| 44 | $value .= 'i'; |
||
| 45 | } |
||
| 46 | |||
| 47 | if (is_null($precision)) {
|
||
| 48 | $precision = $this->getPrecision(); |
||
| 49 | } |
||
| 50 | |||
| 51 | $this->value = $this->translateValue($value); |
||
| 52 | |||
| 53 | return $this; |
||
| 54 | } |
||
| 64 | } |