From 40a07daa31f726df9ff358b898f5fcbd378bdb38 Mon Sep 17 00:00:00 2001
From: Eddie Lau <kahlau@magento.com>
Date: Thu, 17 Mar 2016 14:48:19 -0500
Subject: [PATCH] MAGETWO-50516: Contribute Ogre Bugfixes and Stories for
 Sprint 46

 - fixed code mess
---
 .../Setup/Model/MarketplaceManager.php        | 25 +++++++++----------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/setup/src/Magento/Setup/Model/MarketplaceManager.php b/setup/src/Magento/Setup/Model/MarketplaceManager.php
index 7134769b420..41e4d0b4d2d 100644
--- a/setup/src/Magento/Setup/Model/MarketplaceManager.php
+++ b/setup/src/Magento/Setup/Model/MarketplaceManager.php
@@ -6,11 +6,6 @@
 
 namespace Magento\Setup\Model;
 
-use Zend\ServiceManager\ServiceLocatorInterface;
-use Magento\Framework\App\Filesystem\DirectoryList;
-use Magento\Framework\Filesystem;
-use Zend\View\Model\JsonModel;
-
 class MarketplaceManager
 {
     /**
@@ -81,7 +76,7 @@ class MarketplaceManager
         $this->composerInformation = $composerInformation;
         $this->curlClient = $curl;
         $this->filesystem = $filesystem;
-        $this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
+        $this->directory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::VAR_DIR);
     }
 
     /**
@@ -245,7 +240,8 @@ class MarketplaceManager
      */
     public function getAuthJson()
     {
-        $directory = $this->getFilesystem()->getDirectoryRead(DirectoryList::COMPOSER_HOME);
+        $directory = $this->getFilesystem()
+            ->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME);
         if ($directory->isExist($this->pathToAuthFile) && $directory->isReadable($this->pathToAuthFile)) {
             try {
                 $data = $directory->readFile($this->pathToAuthFile);
@@ -265,7 +261,8 @@ class MarketplaceManager
     public function removeCredentials()
     {
         $serviceUrl = $this->getCredentialBaseUrl();
-        $directory = $this->getFilesystem()->getDirectoryRead(DirectoryList::COMPOSER_HOME);
+        $directory = $this->getFilesystem()
+            ->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME);
         if ($directory->isExist($this->pathToAuthFile) && $directory->isReadable($this->pathToAuthFile)) {
             try {
                 $authJsonData = $this->getAuthJson();
@@ -304,15 +301,17 @@ class MarketplaceManager
                 ]
             ]
         ];
-        $json = new JsonModel($authContent);
+        $json = new \Zend\View\Model\JsonModel($authContent);
         $json->setOption('prettyPrint', true);
         $jsonContent = $json->serialize();
 
         return $this->getDirectory()->writeFile(
-            DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile,
+            \Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME .
+                DIRECTORY_SEPARATOR . $this->pathToAuthFile,
             $jsonContent
         ) && $this->getDirectory()->changePermissions(
-            DirectoryList::COMPOSER_HOME . DIRECTORY_SEPARATOR . $this->pathToAuthFile,
+            \Magento\Framework\App\Filesystem\DirectoryList::COMPOSER_HOME .
+                DIRECTORY_SEPARATOR . $this->pathToAuthFile,
             \Magento\Framework\Filesystem\DriverInterface::WRITEABLE_FILE_MODE
         );
     }
@@ -415,7 +414,7 @@ class MarketplaceManager
     }
 
     /**
-     * @return ServiceLocatorInterface
+     * @return \Zend\ServiceManager\ServiceLocatorInterface
      */
     public function getServiceLocator()
     {
@@ -447,7 +446,7 @@ class MarketplaceManager
     }
 
     /**
-     * @return Filesystem\Directory\Write|Filesystem\Directory\WriteInterface
+     * @return \Magento\Framework\Filesystem\Directory\WriteInterface
      */
     public function getDirectory()
     {
-- 
GitLab