feat: simplify xml parsing, add 'mutable' property for personal data

This commit is contained in:
Björn Fromme committed 2025-01-30 10:40:38 +01:00
1 parent c75f069ce0
commit eae9879519
8 files changed
+47 -32

No files matched your search

@@ -19,10 +19,7 @@ class PersonalDataParser extends AbstractParser
$addressDataNode = $node->filterXPath('//adressdaten');
$dateString = $this->getStringOrNullValue($addressDataNode->filterXPath('//geburtsdatum'));
$personalData->dateOfBirth = null !== $dateString ?
\DateTimeImmutable::createFromFormat('d.m.Y', $dateString) : null;
$personalData->dateOfBirth = $this->getDateOrNullValue($addressDataNode->filterXPath('//geburtsdatum'));
$personalData->firstName = $this->getStringOrNullValue($addressDataNode->filterXPath('//vorname'));
$personalData->name = $this->getStringOrNullValue($addressDataNode->filterXPath('//name'));
$personalData->salutation = $this->getStringOrNullValue($addressDataNode->filterXPath('//anrede'));
@@ -52,8 +49,7 @@ class PersonalDataParser extends AbstractParser
$communication->phone = $this->getStringOrNullValue($contactDataNode->filterXPath('//telefonprivat'));
$communication->mobile = $this->getStringOrNullValue($contactDataNode->filterXPath('//telefonmobil'));
$communication->email = $this->getStringOrNullValue($contactDataNode->filterXPath('//email'));
$communication->newsletter = $this
->stringToBool($this->getStringOrNullValue($contactDataNode->filterXPath('//newsletter')));
$communication->newsletter = $this->getBoolValue($contactDataNode->filterXPath('//newsletter'));
$personalData->communication = $communication;
}