Skip to content

Commit e9f309c

Browse files
Refactor code
1 parent c4d4768 commit e9f309c

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

app/code/Magento/Deploy/Console/DeployStaticOptions.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ class DeployStaticOptions
127127
*/
128128
const NO_LESS = 'no-less';
129129

130-
/**
131-
* Default jobs amount
132-
*/
133130
const DEFAULT_JOBS_AMOUNT = 0;
134131

135132
/**

app/code/Magento/Deploy/Service/DeployStaticContent.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public function __construct(
7575
* @param array $options
7676
* @throws LocalizedException
7777
* @return void
78+
*
79+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
80+
* @SuppressWarnings(PHPMD.NPathComplexity)
7881
*/
7982
public function deploy(array $options)
8083
{
@@ -106,20 +109,20 @@ public function deploy(array $options)
106109

107110
$deployStrategy = $this->deployStrategyFactory->create(
108111
$options[Options::STRATEGY],
109-
[
110-
'queue' => $this->queueFactory->create($queueOptions)
111-
]
112+
['queue' => $this->queueFactory->create($queueOptions)]
112113
);
113114

114115
$packages = $deployStrategy->deploy($options);
115116

116117
if ($options[Options::NO_JAVASCRIPT] !== true) {
117-
$deployRjsConfig = $this->objectManager->create(DeployRequireJsConfig::class, [
118-
'logger' => $this->logger
119-
]);
120-
$deployI18n = $this->objectManager->create(DeployTranslationsDictionary::class, [
121-
'logger' => $this->logger
122-
]);
118+
$deployRjsConfig = $this->objectManager->create(
119+
DeployRequireJsConfig::class,
120+
['logger' => $this->logger]
121+
);
122+
$deployI18n = $this->objectManager->create(
123+
DeployTranslationsDictionary::class,
124+
['logger' => $this->logger]
125+
);
123126
foreach ($packages as $package) {
124127
if (!$package->isVirtual()) {
125128
$deployRjsConfig->deploy($package->getArea(), $package->getTheme(), $package->getLocale());
@@ -129,9 +132,10 @@ public function deploy(array $options)
129132
}
130133

131134
if ($options[Options::NO_JAVASCRIPT] !== true && $options[Options::NO_JS_BUNDLE] !== true) {
132-
$deployBundle = $this->objectManager->create(Bundle::class, [
133-
'logger' => $this->logger
134-
]);
135+
$deployBundle = $this->objectManager->create(
136+
Bundle::class,
137+
['logger' => $this->logger]
138+
);
135139
foreach ($packages as $package) {
136140
if (!$package->isVirtual()) {
137141
$deployBundle->deploy($package->getArea(), $package->getTheme(), $package->getLocale());

app/code/Magento/Deploy/Test/Unit/Service/DeployStaticContentTest.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,15 @@ public function testMaxExecutionTimeOptionPassed()
241241
$strategyMock = $this->createMock(CompactDeploy::class);
242242
$this->queueFactory->expects($this->once())
243243
->method('create')
244-
->with([
245-
'logger' => $this->logger,
246-
'maxExecTime' => 100,
247-
'maxProcesses' => 3,
248-
'options' => $options,
249-
'deployPackageService' => null
250-
])
244+
->with(
245+
[
246+
'logger' => $this->logger,
247+
'maxExecTime' => 100,
248+
'maxProcesses' => 3,
249+
'options' => $options,
250+
'deployPackageService' => null
251+
]
252+
)
251253
->willReturn($queueMock);
252254
$this->deployStrategyFactory->expects($this->once())
253255
->method('create')

0 commit comments

Comments
 (0)