refactor: split buspro ApiClient into domain clients
This commit is contained in:
1 parent
0a55544ca8
commit
b755a6f43e
52 files changed
+805
-695
No files matched your search
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\BusProNet\XmlLoader;
|
||||
|
||||
use App\BusProNet\ApiClient;
|
||||
use App\BusProNet\Client\ReferenceDataClient;
|
||||
use App\BusProNet\Model\Agency;
|
||||
use App\BusProNet\Model\Notification;
|
||||
use Psr\Cache\InvalidArgumentException;
|
||||
@@ -19,7 +19,7 @@ class AgencyLoader
|
||||
|
||||
public function __construct(
|
||||
private readonly CacheInterface $cache,
|
||||
private readonly ApiClient $apiClient,
|
||||
private readonly ReferenceDataClient $referenceDataClient,
|
||||
private readonly LoggerInterface $logger,
|
||||
) {
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class AgencyLoader
|
||||
// Cache for 24 hours (agencies change infrequently)
|
||||
$item->expiresAfter(24 * 60 * 60);
|
||||
|
||||
$result = $this->apiClient->getAgencies();
|
||||
$result = $this->referenceDataClient->getAgencies();
|
||||
|
||||
if ($result instanceof Notification) {
|
||||
$this->logger->error('Failed to fetch agencies from BPN API', [
|
||||
|
||||
Reference in new issue
Block a user