public static function decodeJsonContent($block, $assoc = true)
    {
        $content = $block;
        $blockType = null;
        if (is_object($block)) {
            $content = $block->getContent();
            $blockType = $block->getType();
        }

        $content = json_decode($content, $assoc);
        if (null === $content) {
            $blockTypeInfo = (null !== $blockType) ? ' for the block ' . $blockType . ' ' : '';

            $exception = array(
                'message' => 'exception_wrong_json_format',
                'parameters' => array(
                    '%blockTypeInfo%' => $blockTypeInfo,
                ),
            );
            throw new Exception\InvalidJsonFormatException(json_encode($exception));
        }

        return $content;
    }