/** * @param array|stdObject $data * * @return object */ public function encode($data) { $json = json_encode($data); return JSON::option('pretty_print') ? $this->pretty_print($json) : $json; }