Skip to content

Commit

Permalink
Updated AbstractMagentoCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Aug 10, 2024
1 parent 09f9d3e commit 84a83d0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/N98/Magento/Command/AbstractMagentoCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace N98\Magento\Command;

use Composer\Composer;
Expand All @@ -11,7 +13,6 @@
use Composer\Package\PackageInterface;
use InvalidArgumentException;
use Mage;
use N98\Magento\Application;
use N98\Magento\Command\SubCommand\ConfigBag;
use N98\Magento\Command\SubCommand\SubCommandFactory;
use N98\Util\Console\Helper\DatabaseHelper;
Expand Down Expand Up @@ -112,26 +113,27 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->detectMagento($output, static::$detectMagentoSilent);

if ($input->getOption(static::COMMAND_OPTION_FORMAT) === null) {
$this->writeSection($output, $this->getSectionTitle());
$this->writeSection($output, $this->getSectionTitle($input, $output));
}

if (!$this->initMagento()) {
return Command::FAILURE;
}

$this->getTableHelper()
->setHeaders($this->getListHeader())
->renderByFormat($output, $this->getListData(), $input->getOption(self::COMMAND_OPTION_FORMAT));
->setHeaders($this->getListHeader($input, $output))
->renderByFormat($output, $this->getListData($input, $output), $input->getOption(self::COMMAND_OPTION_FORMAT));

return Command::SUCCESS;
}

return Command::INVALID;
}

private function _initWebsites()
{
$this->_websiteCodeMap = [];
/** @var \Mage_Core_Model_Website[] $websites */
$websites = Mage::app()->getWebsites(false);
$websites = Mage::app()->getWebsites();
foreach ($websites as $website) {
$this->_websiteCodeMap[$website->getId()] = $website->getCode();
}
Expand Down

0 comments on commit 84a83d0

Please sign in to comment.