Total Complexity | 7 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 93.75% |
Changes | 0 |
1 | <?php |
||
24 | class AddressPart extends NameValuePart |
||
25 | { |
||
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 | )); |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * Returns the email address. |
||
44 | * |
||
45 | * @return string The email address. |
||
46 | */ |
||
47 | 1 | public function getEmail() : string |
|
50 | } |
||
51 | |||
52 | 1 | protected function validate() : void |
|
59 |