public function format(array $result, $pretty = false) { $json = json_encode($result); return $pretty ? JSONFormatter::format($json) : $json; }