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