diff --git a/Command/BrevoExportCustomerCommand.php b/Command/BrevoExportCustomerCommand.php
index 8a7eb8c..0a755f8 100644
--- a/Command/BrevoExportCustomerCommand.php
+++ b/Command/BrevoExportCustomerCommand.php
@@ -1,12 +1,20 @@
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
namespace Brevo\Command;
-use Brevo\Api\BrevoClient;
use Brevo\Brevo;
use Brevo\Services\BrevoCustomerService;
use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Thelia\Command\ContainerAwareCommand;
@@ -15,20 +23,17 @@
class BrevoExportCustomerCommand extends ContainerAwareCommand
{
-
public function __construct(
private BrevoCustomerService $brevoCustomerService
- )
- {
+ ) {
parent::__construct();
}
- protected function configure()
+ protected function configure(): void
{
$this
- ->setName("brevo:export:customers")
- ->setDescription("Export customers to brevo");
-
+ ->setName('brevo:export:customers')
+ ->setDescription('Export customers to brevo');
}
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -37,6 +42,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (null === ConfigQuery::read(Brevo::CONFIG_API_SECRET)) {
$output->writeln('Please configure this module in the back office');
+
return Command::FAILURE;
}
@@ -44,22 +50,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$progressBar = ProgressBarHelper::createProgressBar($output, $customers->count());
- try {
- foreach ($customers as $customer) {
- $progressBar->setMessage("".$customer->getEmail()."");
+ foreach ($customers as $customer) {
+ $progressBar->setMessage(''.$customer->getEmail().'');
+ try {
$this->brevoCustomerService->createUpdateContact($customer->getId());
-
- $progressBar->advance();
+ } catch (\Exception $exception) {
+ $progressBar->setMessage(''.$exception->getMessage().'');
}
- $progressBar->finish();
- } catch (\Exception $exception) {
- $output->writeln('error during import : '.$exception->getMessage());
- $progressBar->setMessage("".$exception->getMessage()."");
+ $progressBar->advance();
}
- $output->writeln(" customer export done.");
+ $progressBar->finish();
+
+ $output->writeln(' customer export done.');
return Command::SUCCESS;
}
diff --git a/Config/module.xml b/Config/module.xml
index cc093ed..f807240 100644
--- a/Config/module.xml
+++ b/Config/module.xml
@@ -13,7 +13,7 @@
en_US
fr_FR
- 1.1.9
+ 1.1.10
Chabreuil Antoine