We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41a4cf6 commit 9263b1dCopy full SHA for 9263b1d
lib/internal/Magento/Framework/Controller/Result/Json.php
@@ -52,9 +52,13 @@ public function __construct(
52
* @param boolean $cycleCheck Optional; whether or not to check for object recursion; off by default
53
* @param array $options Additional options used during encoding
54
* @return $this
55
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
56
*/
57
public function setData($data, $cycleCheck = false, $options = [])
58
{
59
+ if ($data instanceof \Magento\Framework\DataObject) {
60
+ $data = $data->toArray();
61
+ }
62
$this->json = $this->serializer->serialize($data);
63
return $this;
64
}
0 commit comments