private function generateDocumentBody(array $metadata)
    {
        $lines = [];

        if ($properties = $this->generateDocumentProperties($metadata)) {
            $lines[] = $properties;
        }

        if ($this->hasMultipleEmbedded($metadata)) {
            $lines[] = $this->generateDocumentConstructor($metadata);
        }

        if ($methods = $this->generateDocumentMethods($metadata)) {
            $lines[] = $methods;
        }

        return rtrim(implode("\n", $lines));
    }