46
46
use Magento \Setup \Module \SetupFactory ;
47
47
use Magento \Setup \Validator \DbValidator ;
48
48
use Magento \Store \Model \Store ;
49
+ use Magento \Framework \App \Cache \Manager ;
49
50
50
51
/**
51
52
* Class Installer contains the logic to install Magento application.
@@ -1272,8 +1273,8 @@ public function uninstall()
1272
1273
*/
1273
1274
private function updateCaches ($ isEnabled , $ types = [])
1274
1275
{
1275
- /** @var \Magento\Framework\App\Cache\ Manager $cacheManager */
1276
- $ cacheManager = $ this ->objectManagerProvider ->get ()->create (\ Magento \ Framework \ App \ Cache \ Manager::class);
1276
+ /** @var Manager $cacheManager */
1277
+ $ cacheManager = $ this ->objectManagerProvider ->get ()->create (Manager::class);
1277
1278
1278
1279
$ availableTypes = $ cacheManager ->getAvailableTypes ();
1279
1280
$ types = empty ($ types ) ? $ availableTypes : array_intersect ($ availableTypes , $ types );
@@ -1292,8 +1293,9 @@ function (string $key) use ($types) {
1292
1293
);
1293
1294
1294
1295
$ this ->log ->log ('Current status: ' );
1295
- // phpcs:ignore Magento2.Functions.DiscouragedFunction
1296
- $ this ->log ->log (print_r ($ cacheStatus , true ));
1296
+ foreach ($ cacheStatus as $ cache => $ status ) {
1297
+ $ this ->log ->log (sprintf ('%s: %d ' , $ cache , $ status ));
1298
+ }
1297
1299
}
1298
1300
1299
1301
/**
@@ -1305,8 +1307,8 @@ function (string $key) use ($types) {
1305
1307
*/
1306
1308
private function cleanCaches ()
1307
1309
{
1308
- /** @var \Magento\Framework\App\Cache\ Manager $cacheManager */
1309
- $ cacheManager = $ this ->objectManagerProvider ->get ()->get (\ Magento \ Framework \ App \ Cache \ Manager::class);
1310
+ /** @var Manager $cacheManager */
1311
+ $ cacheManager = $ this ->objectManagerProvider ->get ()->get (Manager::class);
1310
1312
$ types = $ cacheManager ->getAvailableTypes ();
1311
1313
$ cacheManager ->clean ($ types );
1312
1314
$ this ->log ->log ('Cache cleared successfully ' );
0 commit comments