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

+18
View File
@@ -0,0 +1,18 @@
<?php
namespace App\BusProNet;
use Symfony\Component\DomCrawler\Crawler;
trait XmlParserTrait
{
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;
}
}