Skip to content

Commit c90d2dd

Browse files
author
rostislav
committed
issue-38758 added new constructor param as null and handle with Object Manager, codestyle fixes
1 parent 07a2784 commit c90d2dd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ class DiInfoCommand extends Command
5050
*/
5151
public function __construct(
5252
Information $diInformation,
53-
AreaList $areaList
54-
) {
55-
$this->areaList = $areaList;
53+
?AreaList $areaList = null
54+
)
55+
{
56+
$this->areaList = $areaList ?? \Magento\Framework\App\ObjectManager::getInstance()->get(AreaList::class);
5657
$this->diInformation = $diInformation;
5758
parent::__construct();
5859
}
@@ -202,7 +203,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
202203
* @return void
203204
* @throws \InvalidArgumentException
204205
*/
205-
private function setDiArea($area)
206+
private function setDiArea($area): void
206207
{
207208
if ($this->validateAreaCodeFromInput($area)) {
208209
$objectManager = ObjectManager::getInstance();
@@ -225,7 +226,7 @@ private function setDiArea($area)
225226
* @param string $area
226227
* @return bool
227228
*/
228-
private function validateAreaCodeFromInput($area)
229+
private function validateAreaCodeFromInput($area): bool
229230
{
230231
$availableAreaCodes = $this->areaList->getCodes();
231232
return in_array($area, $availableAreaCodes, true);

0 commit comments

Comments
 (0)