Skip to content

Commit 2891de9

Browse files
author
Igor Melnikov
committed
MAGETWO-60442: Add optional SerializerInterface dependency to child classes of \Magento\Framework\Config\Data
Adding SerializerInterface dependency in the constructor
1 parent 2f3a64b commit 2891de9

File tree

2 files changed

+5
-2
lines changed
  • app/code/Magento/Indexer/Model/Config
  • lib/internal/Magento/Framework/Config

2 files changed

+5
-2
lines changed

app/code/Magento/Indexer/Model/Config/Data.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\Indexer\Model\Config;
77

88
use Magento\Framework\Serialize\SerializerInterface;
9+
use Magento\Framework\Serialize\Serializer\Serialize;
10+
use Magento\Framework\App\ObjectManager;
911

1012
class Data extends \Magento\Framework\Config\Data
1113
{
@@ -29,6 +31,7 @@ public function __construct(
2931
SerializerInterface $serializer = null
3032
) {
3133
$this->stateCollection = $stateCollection;
34+
$serializer = $serializer ?: ObjectManager::getInstance()->get(Serialize::class);
3235

3336
$isCacheExists = $cache->test($cacheId);
3437

lib/internal/Magento/Framework/Config/Data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22
/**
3-
* Config data. Represents loaded and cached configuration data. Should be used to gain access to different types
4-
*
53
* Copyright © 2016 Magento. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
@@ -11,6 +9,8 @@
119
use Magento\Framework\App\ObjectManager;
1210

1311
/**
12+
* Represents loaded and cached configuration data, should be used to gain access to different types
13+
*
1414
* @SuppressWarnings(PHPMD.NumberOfChildren)
1515
*/
1616
class Data implements \Magento\Framework\Config\DataInterface

0 commit comments

Comments
 (0)