feat: refactoring of xml parsers

This commit is contained in:
Björn Fromme
2025-01-24 17:10:49 +01:00
parent 11f1508640
commit 6730c243f6
49 changed files with 1414 additions and 1235 deletions
@@ -0,0 +1,21 @@
<?php
namespace App\BusProNet\XmlParser;
use App\BusProNet\TypeConversionTrait;
use Symfony\Component\DomCrawler\Crawler;
abstract class AbstractParser
{
use TypeConversionTrait;
protected function getStringOrNullValue(Crawler $node): ?string
{
return 0 < $node->count() ? $node->text() : null;
}
protected function getIntOrNullValue(Crawler $node): ?int
{
return 0 < $node->count() ? (int) $node->text() : null;
}
}