Skip to content
Snippets Groups Projects
Commit 2891de98 authored by Igor Melnikov's avatar Igor Melnikov
Browse files

MAGETWO-60442: Add optional SerializerInterface dependency to child classes of...

MAGETWO-60442: Add optional SerializerInterface dependency to child classes of \Magento\Framework\Config\Data

Adding SerializerInterface dependency in the constructor
parent 2f3a64b4
No related merge requests found
......@@ -6,6 +6,8 @@
namespace Magento\Indexer\Model\Config;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\Serialize\Serializer\Serialize;
use Magento\Framework\App\ObjectManager;
class Data extends \Magento\Framework\Config\Data
{
......@@ -29,6 +31,7 @@ class Data extends \Magento\Framework\Config\Data
SerializerInterface $serializer = null
) {
$this->stateCollection = $stateCollection;
$serializer = $serializer ?: ObjectManager::getInstance()->get(Serialize::class);
$isCacheExists = $cache->test($cacheId);
......
<?php
/**
* Config data. Represents loaded and cached configuration data. Should be used to gain access to different types
*
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
......@@ -11,6 +9,8 @@ use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\App\ObjectManager;
/**
* Represents loaded and cached configuration data, should be used to gain access to different types
*
* @SuppressWarnings(PHPMD.NumberOfChildren)
*/
class Data implements \Magento\Framework\Config\DataInterface
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment