| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 26 | public function length() : int |
||
| 27 | { |
||
| 28 | $length = mb_strlen($this->value); |
||
| 29 | |||
| 30 | if (!$this->isGsm7()) { |
||
| 31 | return $length; |
||
| 32 | } |
||
| 33 | |||
| 34 | $doubles = GSM7::DOUBLES; |
||
| 35 | |||
| 36 | for ($i = 0; $i < $length; $i++) { |
||
| 37 | if (in_array($this->value[$i], $doubles)) { |
||
| 38 | $length++; |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | return $length; |
||
| 43 | } |
||
| 44 | |||
| 54 |