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,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use App\BusProNet\ApiClient;
|
||||
use App\BusProNet\Exception\ApiClientException;
|
||||
use App\BusProNet\Transport\XmlChannel;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
@@ -21,7 +21,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
class BpnReplayCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ApiClient $apiClient,
|
||||
private readonly XmlChannel $channel,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -77,7 +77,7 @@ class BpnReplayCommand extends Command
|
||||
$io->info('Sending request to BPN API...');
|
||||
|
||||
try {
|
||||
$response = $this->apiClient->sendRawXml($xml);
|
||||
$response = $this->channel->replay($xml);
|
||||
} catch (ApiClientException $e) {
|
||||
$io->error(sprintf('API request failed: %s', $e->getMessage()));
|
||||
|
||||
|
||||
Reference in new issue
Block a user