From 7b8f8eabfd645936b201167fd1f18b8c40c3df05 Mon Sep 17 00:00:00 2001 From: git-seb <78160594+git-seb@users.noreply.github.com> Date: Tue, 19 May 2026 11:41:45 +0200 Subject: [PATCH] Refactor execute method to return int and handle area code Symfony Console compatibility issue fix + AreaCode handle suggestion --- Console/Command/Import.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Console/Command/Import.php b/Console/Command/Import.php index 0bac4a2..c69ac0a 100644 --- a/Console/Command/Import.php +++ b/Console/Command/Import.php @@ -56,12 +56,16 @@ public function __construct( protected function execute( InputInterface $input, OutputInterface $output - ) { + ): int { $this->input = $input; $this->output = $output; - $this->state->setAreaCode('adminhtml'); + try { + $this->state->getAreaCode(); + } catch (\Magento\Framework\Exception\LocalizedException $e) { + $this->state->setAreaCode('adminhtml'); + } $csvRows = $this->readCsv(); @@ -73,6 +77,7 @@ protected function execute( $this->renderConversion($convertedRows); + return Command::SUCCESS; } protected function convertRows($csvRows){