66
77namespace Magento \Setup \Controller ;
88
9- use Magento \Framework \Composer \ComposerInformation ;
10- use Magento \Framework \Module \ModuleList ;
11- use Magento \Setup \Model \ObjectManagerProvider ;
12- use Zend \Mvc \Controller \AbstractActionController ;
13- use Zend \View \Model \JsonModel ;
14- use Zend \View \Model \ViewModel ;
15- use Magento \Setup \Model \ConnectManager ;
16- use Magento \Setup \Model \UpdatePackagesCache ;
17-
189/**
1910 * Controller for component grid tasks
2011 */
21- class ComponentGrid extends AbstractActionController
12+ class ComponentGrid extends \ Zend \ Mvc \ Controller \ AbstractActionController
2213{
2314 /**
2415 * @var \Magento\Framework\Composer\ComposerInformation
@@ -33,7 +24,7 @@ class ComponentGrid extends AbstractActionController
3324 private $ packageInfo ;
3425
3526 /**
36- * @var ConnectManager
27+ * @var \Magento\Setup\Model\ ConnectManager
3728 */
3829 private $ connectManager ;
3930
@@ -55,16 +46,16 @@ class ComponentGrid extends AbstractActionController
5546 private $ updatePackagesCache ;
5647
5748 /**
58- * @param ComposerInformation $composerInformation
59- * @param ObjectManagerProvider $objectManagerProvider
60- * @param ConnectManager $connectManager
61- * @param UpdatePackagesCache $updatePackagesCache
49+ * @param \Magento\Framework\Composer\ ComposerInformation $composerInformation
50+ * @param \Magento\Setup\Model\ ObjectManagerProvider $objectManagerProvider
51+ * @param \Magento\Setup\Model\ ConnectManager $connectManager
52+ * @param \Magento\Setup\Model\ UpdatePackagesCache $updatePackagesCache
6253 */
6354 public function __construct (
64- ComposerInformation $ composerInformation ,
65- ObjectManagerProvider $ objectManagerProvider ,
66- UpdatePackagesCache $ updatePackagesCache ,
67- ConnectManager $ connectManager
55+ \ Magento \ Framework \ Composer \ ComposerInformation $ composerInformation ,
56+ \ Magento \ Setup \ Model \ ObjectManagerProvider $ objectManagerProvider ,
57+ \ Magento \ Setup \ Model \ UpdatePackagesCache $ updatePackagesCache ,
58+ \ Magento \ Setup \ Model \ ConnectManager $ connectManager
6859 ) {
6960 $ this ->composerInformation = $ composerInformation ;
7061 $ objectManager = $ objectManagerProvider ->get ();
@@ -78,19 +69,19 @@ public function __construct(
7869 /**
7970 * Index page action
8071 *
81- * @return ViewModel
72+ * @return \Zend\View\Model\ ViewModel
8273 */
8374 public function indexAction ()
8475 {
85- $ view = new ViewModel ();
76+ $ view = new \ Zend \ View \ Model \ ViewModel ();
8677 $ view ->setTerminal (true );
8778 return $ view ;
8879 }
8980
9081 /**
9182 * Get Components info action
9283 *
93- * @return JsonModel
84+ * @return \Zend\View\Model\ JsonModel
9485 * @throws \RuntimeException
9586 * @SuppressWarnings(PHPMD.NPathComplexity)
9687 */
@@ -105,7 +96,7 @@ public function componentsAction()
10596 $ components [$ component ['name ' ]]['uninstall ' ] = false ;
10697 $ components [$ component ['name ' ]]['moduleName ' ] = $ this ->packageInfo ->getModuleName ($ component ['name ' ]);
10798 if ($ this ->composerInformation ->isPackageInComposerJson ($ component ['name ' ])
108- && ($ component ['type ' ] !== ComposerInformation::METAPACKAGE_PACKAGE_TYPE )) {
99+ && ($ component ['type ' ] !== \ Magento \ Framework \ Composer \ ComposerInformation::METAPACKAGE_PACKAGE_TYPE )) {
109100 $ components [$ component ['name ' ]]['uninstall ' ] = true ;
110101 if (isset ($ lastSyncData ['packages ' ][$ component ['name ' ]]['latestVersion ' ])
111102 && version_compare (
@@ -116,7 +107,7 @@ public function componentsAction()
116107 $ components [$ component ['name ' ]]['update ' ] = true ;
117108 }
118109 }
119- if ($ component ['type ' ] === ComposerInformation::MODULE_PACKAGE_TYPE ) {
110+ if ($ component ['type ' ] === \ Magento \ Framework \ Composer \ ComposerInformation::MODULE_PACKAGE_TYPE ) {
120111 $ components [$ component ['name ' ]]['enable ' ] =
121112 $ this ->enabledModuleList ->has ($ components [$ component ['name ' ]]['moduleName ' ]);
122113 $ components [$ component ['name ' ]]['disable ' ] = !$ components [$ component ['name ' ]]['enable ' ];
@@ -134,7 +125,7 @@ public function componentsAction()
134125 isset ($ packagesForInstall ['packages ' ]) ? count ($ packagesForInstall ['packages ' ]) : 0 ;
135126 $ lastSyncData ['countOfUpdate ' ] = isset ($ lastSyncData ['packages ' ]) ? count ($ lastSyncData ['packages ' ]) : 0 ;
136127
137- return new JsonModel (
128+ return new \ Zend \ View \ Model \ JsonModel (
138129 [
139130 'success ' => true ,
140131 'components ' => array_values ($ components ),
@@ -147,7 +138,7 @@ public function componentsAction()
147138 /**
148139 * Sync action
149140 *
150- * @return JsonModel
141+ * @return \Zend\View\Model\ JsonModel
151142 */
152143 public function syncAction ()
153144 {
@@ -162,7 +153,7 @@ public function syncAction()
162153 $ lastSyncData ['countOfUpdate ' ] = isset ($ lastSyncData ['packages ' ]) ? count ($ lastSyncData ['packages ' ]) : 0 ;
163154
164155
165- return new JsonModel (
156+ return new \ Zend \ View \ Model \ JsonModel (
166157 [
167158 'success ' => true ,
168159 'lastSyncData ' => $ lastSyncData
@@ -182,7 +173,7 @@ private function getAllModules()
182173 foreach ($ allModules as $ module ) {
183174 $ moduleName = $ this ->packageInfo ->getPackageName ($ module );
184175 $ modules [$ moduleName ]['name ' ] = $ moduleName ;
185- $ modules [$ moduleName ]['type ' ] = ComposerInformation::MODULE_PACKAGE_TYPE ;
176+ $ modules [$ moduleName ]['type ' ] = \ Magento \ Framework \ Composer \ ComposerInformation::MODULE_PACKAGE_TYPE ;
186177 $ modules [$ moduleName ]['version ' ] = $ this ->packageInfo ->getVersion ($ module );
187178 }
188179 return $ modules ;
0 commit comments