6
6
namespace Magento \Backend \Block \Media ;
7
7
8
8
use Magento \Framework \App \ObjectManager ;
9
+ use Magento \Framework \Serialize \Serializer \Json ;
9
10
10
11
/**
11
12
* Adminhtml media library uploader
@@ -30,25 +31,24 @@ class Uploader extends \Magento\Backend\Block\Widget
30
31
protected $ _fileSizeService ;
31
32
32
33
/**
33
- * @var \Magento\Framework\ Json\EncoderInterface
34
+ * @var Json
34
35
*/
35
- protected $ _jsonEncoder ;
36
+ private $ jsonEncoder ;
36
37
37
38
/**
38
39
* @param \Magento\Backend\Block\Template\Context $context
39
40
* @param \Magento\Framework\File\Size $fileSize
40
41
* @param array $data
41
- * @param \Magento\Framework\ Json\EncoderInterface $jsonEncoder
42
+ * @param Json $jsonEncoder
42
43
*/
43
44
public function __construct (
44
45
\Magento \Backend \Block \Template \Context $ context ,
45
46
\Magento \Framework \File \Size $ fileSize ,
46
47
array $ data = [],
47
- \ Magento \ Framework \ Json \ EncoderInterface $ jsonEncoder = null
48
+ Json $ jsonEncoder = null
48
49
) {
49
- $ this ->_jsonEncoder = $ jsonEncoder ?:
50
- ObjectManager::getInstance ()->get (\Magento \Framework \Json \EncoderInterface::class);
51
50
$ this ->_fileSizeService = $ fileSize ;
51
+ $ this ->jsonEncoder = $ jsonEncoder ?: ObjectManager::getInstance ()->get (Json::class);
52
52
parent ::__construct ($ context , $ data );
53
53
}
54
54
@@ -118,7 +118,7 @@ public function getJsObjectName()
118
118
*/
119
119
public function getConfigJson ()
120
120
{
121
- return $ this ->_jsonEncoder ->encode ($ this ->getConfig ()->getData ());
121
+ return $ this ->jsonEncoder ->encode ($ this ->getConfig ()->getData ());
122
122
}
123
123
124
124
/**
0 commit comments