refactor: inject AgeConstraintParserRegistry into TravelParser
This commit is contained in:
1 parent
a8d2852313
commit
a6ed60462d
3 files changed
+14
-25
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user