| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 2 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 4 | public function toTexts(array $context): iterable |
|
| 29 | 4 | { |
|
| 30 | $encoding = mb_detect_encoding($this->string, null, true); |
||
| 31 | |||
| 32 | if ($encoding === false) { |
||
| 33 | throw new RuntimeException( |
||
| 34 | \Safe\sprintf( |
||
| 35 | 'Coulnd\'t detect enconding of string:' . PHP_EOL . '%s', |
||
| 36 | $this->string |
||
| 37 | ) |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | |||
| 41 | yield new Text($this->string, $encoding, $context); |
||
|
|
|||
| 42 | } |
||
| 44 |