| Conditions | 4 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 99 | protected function getValueFromParts(array $parts) : string |
|
| 27 | { |
||
| 28 | 99 | return \implode('', \array_map( |
|
| 29 | 99 | function($p) { |
|
|
|
|||
| 30 | 99 | if ($p instanceof AddressPart) { |
|
| 31 | 95 | return $p->getValue(); |
|
| 32 | 99 | } elseif ($p instanceof QuotedLiteralPart && $p->getValue() !== '') { |
|
| 33 | 2 | return '"' . \preg_replace('/(["\\\])/', '\\\$1', $p->getValue()) . '"'; |
|
| 34 | } |
||
| 35 | 99 | return \preg_replace('/\s+/', '', $p->getValue()); |
|
| 36 | 99 | }, |
|
| 37 | 99 | $parts |
|
| 38 | 99 | )); |
|
| 58 |