src/Response/Response.php
public function sendJson($data, $statusCode = null)
    {
        return $this->setStatusCode($statusCode)
                    ->setJsonBody($data)
                    ->send();
    }
public function sendJson($data, $statusCode = null)
    {
        return $this->setStatusCode($statusCode)
                    ->setJsonBody($data)
                    ->send();
    }
public function sendJson ( $ data , $ statusCode = null ) { return $ this -> setStatusCode ( $ statusCode ) -> setJsonBody ( $ data ) -> send ( ) ; }
Send JSON response with an optional statuscode.

@param mixed   $data       to be encoded as json.
@param integer $statusCode optional statuscode to send.

@return self
Send JSON response with an optional statuscode .