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