Skip to content

Commit 4a83403

Browse files
committed
MAGETWO-38567: Dependency Validation of Physical Non-Composer Theme from Uninstalled Theme
- removed dependency to App\State
1 parent 40f8a0c commit 4a83403

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

app/code/Magento/Theme/Console/Command/ThemeUninstallCommand.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Framework\App\Area;
1010
use Magento\Framework\App\Cache;
1111
use Magento\Framework\App\MaintenanceMode;
12-
use Magento\Framework\App\State;
12+
use Magento\Framework\App\State\CleanupFiles;
1313
use Magento\Framework\Composer\ComposerInformation;
1414
use Magento\Framework\Composer\DependencyChecker;
1515
use Magento\Framework\Composer\Remove;
@@ -89,13 +89,6 @@ class ThemeUninstallCommand extends Command
8989
*/
9090
private $themeProvider;
9191

92-
/**
93-
* Application States
94-
*
95-
* @var State
96-
*/
97-
private $appState;
98-
9992
/**
10093
* System cache model
10194
*
@@ -106,7 +99,7 @@ class ThemeUninstallCommand extends Command
10699
/**
107100
* Cleaning up application state service
108101
*
109-
* @var State\CleanupFiles
102+
* @var CleanupFiles
110103
*/
111104
private $cleanupFiles;
112105

@@ -121,29 +114,27 @@ class ThemeUninstallCommand extends Command
121114
* Constructor
122115
*
123116
* @param Cache $cache
124-
* @param State\CleanupFiles $cleanupFiles
117+
* @param CleanupFiles $cleanupFiles
125118
* @param ComposerInformation $composer
126119
* @param MaintenanceMode $maintenanceMode
127120
* @param Filesystem $filesystem
128121
* @param DependencyChecker $dependencyChecker
129122
* @param Collection $themeCollection
130123
* @param ThemeProvider $themeProvider
131124
* @param Remove $remove
132-
* @param State $appState
133125
* @param BackupRollbackFactory $backupRollbackFactory
134126
* @throws LocalizedException
135127
*/
136128
public function __construct(
137129
Cache $cache,
138-
State\CleanupFiles $cleanupFiles,
130+
CleanupFiles $cleanupFiles,
139131
ComposerInformation $composer,
140132
MaintenanceMode $maintenanceMode,
141133
Filesystem $filesystem,
142134
DependencyChecker $dependencyChecker,
143135
Collection $themeCollection,
144136
ThemeProvider $themeProvider,
145137
Remove $remove,
146-
State $appState,
147138
BackupRollbackFactory $backupRollbackFactory
148139
) {
149140
$this->cache = $cache;
@@ -155,8 +146,6 @@ public function __construct(
155146
$this->remove = $remove;
156147
$this->themeCollection = $themeCollection;
157148
$this->themeProvider = $themeProvider;
158-
$this->appState = $appState;
159-
$this->appState->setAreaCode(Area::AREA_ADMIN);
160149
$this->backupRollbackFactory = $backupRollbackFactory;
161150
parent::__construct();
162151
}

app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function setUp()
9191
$this->cache = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
9292
$this->cleanupFiles = $this->getMock('Magento\Framework\App\State\CleanupFiles', [], [], '', false);
9393
$this->themeProvider = $this->getMock('Magento\Theme\Model\Theme\ThemeProvider', [], [], '', false);
94-
$state = $this->getMock('Magento\Framework\App\State', [], [], '', false);
9594
$this->backupRollbackFactory = $this->getMock(
9695
'Magento\Framework\Setup\BackupRollbackFactory',
9796
[],
@@ -109,7 +108,6 @@ public function setUp()
109108
$this->collection,
110109
$this->themeProvider,
111110
$this->remove,
112-
$state,
113111
$this->backupRollbackFactory
114112
);
115113
$this->tester = new CommandTester($this->command);

0 commit comments

Comments
 (0)