private static function errorJson($statusCode, $message)
    {
        $output = ['error' => $statusCode];

        if (!empty($message)) {
            $output['message'] = $message;
        }

        return json_encode($output);
    }
private static function errorJson($statusCode, $message)
    {
        $output = ['error' => $statusCode];

        if (!empty($message)) {
            $output['message'] = $message;
        }

        return json_encode($output);
    }
private static function errorJson ( $ statusCode , $ message ) { $ output = [ 'error' => $ statusCode ] ; if ( ! empty ( $ message ) ) { $ output [ 'message' ] = $ message ; } return json_encode ( $ output ) ; }
Print the error as json.

@param int    $statusCode
@param string $message

@return string
Print the error as json .