3
3
* Copyright © 2016 Magento. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
-
7
6
namespace Magento \Deploy \Console \Command ;
8
7
9
8
use Magento \Framework \App \Utility \Files ;
19
18
use Magento \Framework \App \State ;
20
19
use Magento \Deploy \Console \Command \DeployStaticOptionsInterface as Options ;
21
20
use Magento \Deploy \Model \DeployManager ;
21
+ use Magento \Framework \App \Cache ;
22
+ use Magento \Framework \App \Cache \Type \Dummy as DummyCache ;
22
23
23
24
/**
24
25
* Deploy static content command
@@ -29,7 +30,7 @@ class DeployStaticContentCommand extends Command
29
30
/**
30
31
* Key for dry-run option
31
32
* @deprecated
32
- * @see Magento\Deploy\Console\Command\DeployStaticOptionsInterface::DRY_RUN
33
+ * @see \ Magento\Deploy\Console\Command\DeployStaticOptionsInterface::DRY_RUN
33
34
*/
34
35
const DRY_RUN_OPTION = 'dry-run ' ;
35
36
@@ -87,6 +88,7 @@ class DeployStaticContentCommand extends Command
87
88
* @param ObjectManagerFactory $objectManagerFactory
88
89
* @param Locale $validator
89
90
* @param ObjectManagerInterface $objectManager
91
+ * @throws \LogicException When the command name is empty
90
92
*/
91
93
public function __construct (
92
94
ObjectManagerFactory $ objectManagerFactory ,
@@ -374,6 +376,7 @@ private function getDeployableEntities($entities, $includedEntities, $excludedEn
374
376
/**
375
377
* {@inheritdoc}
376
378
* @throws \InvalidArgumentException
379
+ * @throws LocalizedException
377
380
*/
378
381
protected function execute (InputInterface $ input , OutputInterface $ output )
379
382
{
@@ -395,9 +398,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
395
398
list ($ deployableLanguages , $ deployableAreaThemeMap , $ requestedThemes )
396
399
= $ this ->prepareDeployableEntities ($ filesUtil );
397
400
398
- $ output ->writeln (" Requested languages: " . implode (', ' , $ deployableLanguages ));
399
- $ output ->writeln (" Requested areas: " . implode (', ' , array_keys ($ deployableAreaThemeMap )));
400
- $ output ->writeln (" Requested themes: " . implode (', ' , $ requestedThemes ));
401
+ $ output ->writeln (' Requested languages: ' . implode (', ' , $ deployableLanguages ));
402
+ $ output ->writeln (' Requested areas: ' . implode (', ' , array_keys ($ deployableAreaThemeMap )));
403
+ $ output ->writeln (' Requested themes: ' . implode (', ' , $ requestedThemes ));
401
404
402
405
/** @var $deployManager DeployManager */
403
406
$ deployManager = $ this ->objectManager ->create (
@@ -427,6 +430,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
427
430
428
431
/**
429
432
* @param Files $filesUtil
433
+ * @throws \InvalidArgumentException
430
434
* @return array
431
435
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
432
436
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -484,20 +488,26 @@ private function prepareDeployableEntities($filesUtil)
484
488
return [$ deployableLanguages , $ deployableAreaThemeMap , $ requestedThemes ];
485
489
}
486
490
491
+ /**
492
+ * Mock Cache class with dummy implementation
493
+ */
487
494
private function disableCache ()
488
495
{
489
496
$ this ->objectManager ->configure ([
490
497
'preferences ' => [
491
- \ Magento \ Framework \ App \ Cache::class => \ Magento \ Framework \ App \ Cache \ Type \Dummy ::class
498
+ Cache::class => DummyCache ::class
492
499
]
493
500
]);
494
501
}
495
502
503
+ /**
504
+ * Unmock Cache class
505
+ */
496
506
private function enableCache ()
497
507
{
498
508
$ this ->objectManager ->configure ([
499
509
'preferences ' => [
500
- \ Magento \ Framework \ App \ Cache::class => \ Magento \ Framework \ App \ Cache::class
510
+ Cache::class => Cache::class
501
511
]
502
512
]);
503
513
}
0 commit comments