feat: refactoring of xml parsers

This commit is contained in:
Björn Fromme committed 2025-01-24 17:10:49 +01:00
1 parent 11f1508640
commit 6730c243f6
49 files changed
+1414 -1235

No files matched your search

@@ -0,0 +1,18 @@
<?php
namespace App\BusProNet\XmlParser;
use App\BusProNet\Model\BookingUpdate;
use Symfony\Component\DomCrawler\Crawler;
class BookingUpdateParser extends AbstractParser
{
public function parse(Crawler $node): BookingUpdate
{
$bookingUpdate = new BookingUpdate();
$bookingUpdate->valid = 'möglich' === $node->filterXPath('//aenderung')->text();
$bookingUpdate->totalPrice = $this->stringToFloat($node->filterXPath('//gesamtpreis')->text());
return $bookingUpdate;
}
}