refactor: inject AgeConstraintParserRegistry into TravelParser

This commit is contained in:
Björn Fromme committed 2026-06-26 17:20:42 +02:00
1 parent a8d2852313
commit a6ed60462d
3 files changed
+14 -25

No files matched your search

+11 -2
View File
@@ -3,18 +3,27 @@
namespace App\BusProNet\XmlLoader;
use App\BusProNet\Traits\TypeConversionTrait;
use App\BusProNet\Traits\XmlParserTrait;
use League\Flysystem\FilesystemOperator;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Contracts\Cache\CacheInterface;
abstract class AbstractLoader
{
use TypeConversionTrait;
use XmlParserTrait;
public function __construct(
protected readonly CacheInterface $cache,
protected readonly FilesystemOperator $xmlExport,
) {
}
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;
}
}