File tree 1 file changed +12
-3
lines changed
lib/internal/Magento/Framework/Controller/Result 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,21 @@ class Json extends AbstractResult
28
28
*/
29
29
protected $ json ;
30
30
31
+ /**
32
+ * @var \Magento\Framework\Serialize\Serializer\Json
33
+ */
34
+ private $ serializer ;
35
+
31
36
/**
32
37
* @param \Magento\Framework\Translate\InlineInterface $translateInline
33
38
*/
34
- public function __construct (InlineInterface $ translateInline )
35
- {
39
+ public function __construct (
40
+ InlineInterface $ translateInline ,
41
+ \Magento \Framework \Serialize \Serializer \Json $ serializer = null
42
+ ) {
36
43
$ this ->translateInline = $ translateInline ;
44
+ $ this ->serializer = $ serializer ?: \Magento \Framework \App \ObjectManager::getInstance ()
45
+ ->get (\Magento \Framework \Serialize \Serializer \Json::class);
37
46
}
38
47
39
48
/**
@@ -46,7 +55,7 @@ public function __construct(InlineInterface $translateInline)
46
55
*/
47
56
public function setData ($ data , $ cycleCheck = false , $ options = [])
48
57
{
49
- $ this ->json = \Zend_Json:: encode ($ data, $ cycleCheck , $ options );
58
+ $ this ->json = $ this -> serializer -> serialize ($ data );
50
59
return $ this ;
51
60
}
52
61
You can’t perform that action at this time.
0 commit comments