Skip to content

Commit c98e03f

Browse files
committed
fixed classes with new keyword
1 parent 1818eaf commit c98e03f

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

setup/src/Magento/Setup/Controller/Navigation.php

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
use Zend\View\Model\ViewModel;
1616

1717
/**
18-
* Class Navigation
19-
*
18+
* Controller Navigation class
2019
*/
2120
class Navigation extends AbstractActionController
2221
{
@@ -35,6 +34,11 @@ class Navigation extends AbstractActionController
3534
*/
3635
protected $view;
3736

37+
/**
38+
* @var JsonModel
39+
*/
40+
protected $json;
41+
3842
/**
3943
* @var ObjectManagerProvider $objectManagerProvider
4044
*/
@@ -43,13 +47,22 @@ class Navigation extends AbstractActionController
4347
/**
4448
* @param NavModel $navigation
4549
* @param Status $status
50+
* @param ViewModel $viewModel
51+
* @param JsonModel $jsonModel
52+
* @param ObjectManagerProvider $objectManagerProvider
4653
*/
47-
public function __construct(NavModel $navigation, Status $status, ObjectManagerProvider $objectManagerProvider)
48-
{
54+
public function __construct(
55+
NavModel $navigation,
56+
Status $status,
57+
ViewModel $viewModel,
58+
JsonModel $jsonModel,
59+
ObjectManagerProvider $objectManagerProvider
60+
) {
4961
$this->navigation = $navigation;
5062
$this->status = $status;
51-
$this->objectManagerProvider = $objectManagerProvider;
52-
$this->view = new ViewModel();
63+
$this->objectManagerProvider = $objectManagerProvider->get();
64+
$this->view = $viewModel;
65+
$this->json = $jsonModel;
5366
$this->view->setVariable('menu', $this->navigation->getMenuItems());
5467
$this->view->setVariable('main', $this->navigation->getMainItems());
5568
}
@@ -59,12 +72,11 @@ public function __construct(NavModel $navigation, Status $status, ObjectManagerP
5972
*/
6073
public function indexAction()
6174
{
62-
$json = new JsonModel();
63-
$json->setVariable('nav', $this->navigation->getData());
64-
$json->setVariable('menu', $this->navigation->getMenuItems());
65-
$json->setVariable('main', $this->navigation->getMainItems());
66-
$json->setVariable('titles', $this->navigation->getTitles());
67-
return $json;
75+
$this->json->setVariable('nav', $this->navigation->getData());
76+
$this->json->setVariable('menu', $this->navigation->getMenuItems());
77+
$this->json->setVariable('main', $this->navigation->getMainItems());
78+
$this->json->setVariable('titles', $this->navigation->getTitles());
79+
return $this->json;
6880
}
6981

7082
/**
@@ -86,7 +98,7 @@ public function menuAction()
8698
public function sideMenuAction()
8799
{
88100
/** @var UrlInterface $backendUrl */
89-
$backendUrl = $this->objectManagerProvider->get()->get(UrlInterface::class);
101+
$backendUrl = $this->objectManagerProvider->get(UrlInterface::class);
90102

91103
$this->view->setTemplate('/magento/setup/navigation/side-menu.phtml');
92104
$this->view->setVariable('isInstaller', $this->navigation->getType() == NavModel::NAV_INSTALLER);

0 commit comments

Comments
 (0)