refactor: split buspro ApiClient into domain clients

This commit is contained in:
fromme committed 2026-10-02 13:55:30 +02:00
1 parent 0a55544ca8
commit b755a6f43e
52 files changed
+805 -695

No files matched your search

+3 -3
View File
@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace App\Command;
use App\BusProNet\ApiClient;
use App\BusProNet\Client\TravelClient;
use App\BusProNet\Exception\ApiClientException;
use League\Flysystem\FilesystemException;
use League\Flysystem\FilesystemOperator;
@@ -29,7 +29,7 @@ class BpnFetchTravelCommand extends Command
];
public function __construct(
private readonly ApiClient $apiClient,
private readonly TravelClient $travelClient,
private readonly FilesystemOperator $xmlExport,
private readonly CacheInterface $cache,
private readonly LoggerInterface $logger,
@@ -56,7 +56,7 @@ class BpnFetchTravelCommand extends Command
$io->text(sprintf('Fetching travel data for product ID %d...', $travelId));
try {
$xml = $this->apiClient->getTravelDataXml($travelId);
$xml = $this->travelClient->getTravelDataXml($travelId);
} catch (ApiClientException $e) {
$io->error(sprintf('API request failed: %s', $e->getMessage()));
$this->logger->error('Failed to fetch travel data from API', [