Skip to content

Commit 758a51b

Browse files
ENGCOM-7265: #27091 Removed array print while setup upgrade #27567
- Merge Pull Request #27567 from srsathish92/magento2:bug/27091-remove-array-print - Merged commits: 1. d95a65a 2. 981df7b 3. 16ebd28 4. a044c53 5. 075f997 6. 479166e
2 parents 79b58c9 + 479166e commit 758a51b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

setup/src/Magento/Setup/Model/Installer.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
use Magento\Setup\Module\SetupFactory;
4747
use Magento\Setup\Validator\DbValidator;
4848
use Magento\Store\Model\Store;
49+
use Magento\Framework\App\Cache\Manager;
4950

5051
/**
5152
* Class Installer contains the logic to install Magento application.
@@ -1311,8 +1312,8 @@ public function uninstall()
13111312
*/
13121313
private function updateCaches($isEnabled, $types = [])
13131314
{
1314-
/** @var \Magento\Framework\App\Cache\Manager $cacheManager */
1315-
$cacheManager = $this->objectManagerProvider->get()->create(\Magento\Framework\App\Cache\Manager::class);
1315+
/** @var Manager $cacheManager */
1316+
$cacheManager = $this->objectManagerProvider->get()->create(Manager::class);
13161317

13171318
$availableTypes = $cacheManager->getAvailableTypes();
13181319
$types = empty($types) ? $availableTypes : array_intersect($availableTypes, $types);
@@ -1331,8 +1332,9 @@ function (string $key) use ($types) {
13311332
);
13321333

13331334
$this->log->log('Current status:');
1334-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1335-
$this->log->log(print_r($cacheStatus, true));
1335+
foreach ($cacheStatus as $cache => $status) {
1336+
$this->log->log(sprintf('%s: %d', $cache, $status));
1337+
}
13361338
}
13371339

13381340
/**
@@ -1344,8 +1346,8 @@ function (string $key) use ($types) {
13441346
*/
13451347
private function cleanCaches()
13461348
{
1347-
/** @var \Magento\Framework\App\Cache\Manager $cacheManager */
1348-
$cacheManager = $this->objectManagerProvider->get()->get(\Magento\Framework\App\Cache\Manager::class);
1349+
/** @var Manager $cacheManager */
1350+
$cacheManager = $this->objectManagerProvider->get()->get(Manager::class);
13491351
$types = $cacheManager->getAvailableTypes();
13501352
$cacheManager->clean($types);
13511353
$this->log->log('Cache cleared successfully');

setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,20 +450,19 @@ public function installDataProvider()
450450
['Installing user configuration...'],
451451
['Enabling caches:'],
452452
['Current status:'],
453-
[print_r(['foo' => 1, 'bar' => 1], true)],
453+
['foo: 1'],
454+
['bar: 1'],
454455
['Installing data...'],
455456
['Data install/update:'],
456457
['Disabling caches:'],
457458
['Current status:'],
458-
[print_r([], true)],
459459
['Module \'Foo_One\':'],
460460
['Module \'Bar_Two\':'],
461461
['Data post-updates:'],
462462
['Module \'Foo_One\':'],
463463
['Module \'Bar_Two\':'],
464464
['Enabling caches:'],
465465
['Current status:'],
466-
[print_r([], true)],
467466
['Caches clearing:'],
468467
['Cache cleared successfully'],
469468
['Disabling Maintenance Mode:'],
@@ -502,20 +501,19 @@ public function installDataProvider()
502501
['Installing user configuration...'],
503502
['Enabling caches:'],
504503
['Current status:'],
505-
[print_r(['foo' => 1, 'bar' => 1], true)],
504+
['foo: 1'],
505+
['bar: 1'],
506506
['Installing data...'],
507507
['Data install/update:'],
508508
['Disabling caches:'],
509509
['Current status:'],
510-
[print_r([], true)],
511510
['Module \'Foo_One\':'],
512511
['Module \'Bar_Two\':'],
513512
['Data post-updates:'],
514513
['Module \'Foo_One\':'],
515514
['Module \'Bar_Two\':'],
516515
['Enabling caches:'],
517516
['Current status:'],
518-
[print_r([], true)],
519517
['Installing admin user...'],
520518
['Caches clearing:'],
521519
['Cache cleared successfully'],

0 commit comments

Comments
 (0)