Skip to content

Commit 201c8e0

Browse files
author
Timon de Groot
committed
Fix backward incompatible changes
1 parent 048a2ee commit 201c8e0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\MediaStorage\Console\Command;
99

1010
use Magento\Framework\App\Area;
11+
use Magento\Framework\App\ObjectManager;
1112
use Magento\Framework\App\State;
1213
use Magento\MediaStorage\Service\ImageResize;
1314
use Symfony\Component\Console\Helper\ProgressBar;
@@ -36,16 +37,19 @@ class ImagesResizeCommand extends \Symfony\Component\Console\Command\Command
3637
* @param State $appState
3738
* @param ImageResize $resize
3839
* @param ProgressBarFactory $progressBarFactory
40+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3941
*/
4042
public function __construct(
4143
State $appState,
4244
ImageResize $resize,
43-
ProgressBarFactory $progressBarFactory
45+
$objectManager = null,
46+
ProgressBarFactory $progressBarFactory = null
4447
) {
4548
parent::__construct();
4649
$this->resize = $resize;
4750
$this->appState = $appState;
48-
$this->progressBarFactory = $progressBarFactory;
51+
$this->progressBarFactory = $progressBarFactory
52+
?: ObjectManager::getInstance()->get(ProgressBarFactory::class);
4953
}
5054

5155
/**
@@ -92,5 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9296

9397
$output->write(PHP_EOL);
9498
$output->writeln("<info>Product images resized successfully</info>");
99+
100+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
95101
}
96102
}

0 commit comments

Comments
 (0)