Skip to content

Commit ed345a1

Browse files
author
rostislav
committed
issue-38703 codestyle issues fix
1 parent d72c7ae commit ed345a1

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

app/code/Magento/Developer/Console/Command/DiInfoCommand.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Magento\Developer\Console\Command;
88

99
use Magento\Developer\Model\Di\Information;
10-
use Magento\Framework\App\ObjectManager;
10+
use Magento\Framework\ObjectManagerInterface;
1111
use Symfony\Component\Console\Command\Command;
1212
use Symfony\Component\Console\Exception\InvalidArgumentException;
1313
use Symfony\Component\Console\Helper\Table;
@@ -19,6 +19,12 @@
1919

2020
class DiInfoCommand extends Command
2121
{
22+
/**
23+
* @var ObjectManagerInterface
24+
*/
25+
private ObjectManagerInterface $objectManager;
26+
27+
2228
/**
2329
* Command name
2430
*/
@@ -50,10 +56,12 @@ class DiInfoCommand extends Command
5056
*/
5157
public function __construct(
5258
Information $diInformation,
59+
ObjectManagerInterface $objectManager,
5360
?AreaList $areaList = null
5461
)
5562
{
5663
$this->diInformation = $diInformation;
64+
$this->objectManager = $objectManager;
5765
$this->areaList = $areaList ?? \Magento\Framework\App\ObjectManager::getInstance()->get(AreaList::class);
5866
parent::__construct();
5967
}
@@ -203,18 +211,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
203211
* @return void
204212
* @throws \InvalidArgumentException
205213
*/
206-
private function setDiArea($area): void
214+
private function setDiArea(string $area): void
207215
{
208216
if ($this->validateAreaCodeFromInput($area)) {
209-
$objectManager = ObjectManager::getInstance();
210-
211-
$areaOmConfiguration = $objectManager
217+
$areaOmConfiguration = $this->objectManager
212218
->get(\Magento\Framework\App\ObjectManager\ConfigLoader::class)
213219
->load($area);
214220

215-
$objectManager->configure($areaOmConfiguration);
221+
$this->objectManager->configure($areaOmConfiguration);
216222

217-
$objectManager->get(\Magento\Framework\Config\ScopeInterface::class)
223+
$this->objectManager->get(\Magento\Framework\Config\ScopeInterface::class)
218224
->setCurrentScope($area);
219225
} else {
220226
throw new InvalidArgumentException(sprintf('The "%s" area code does not exist', $area));

0 commit comments

Comments
 (0)