public static function hydrate(stdClass $summary)
    {
        $hydrated = new SummaryEntity();

        if (isset($summary->id)) {
            $hydrated->setId($summary->id);
        }

        if (isset($summary->line)) {
            $hydrated->setLine($summary->line);
        }

        if (isset($summary->content)) {
            $hydrated->setContent($summary->content);
        }

        if (isset($summary->highlighted_content)) {
            $hydrated->setHighlightedContent($summary->highlighted_content);
        }

        if (isset($summary->file)) {
            $hydrated->setFile(FileHydrator::hydrate($summary->file));
        }

        if (isset($summary->function)) {
            $hydrated->setFunction(CustomFunctionHydrator::hydrate($summary->function));
        }

        if (isset($summary->class)) {
            $hydrated->setClass(CustomClassHydrator::hydrate($summary->class));
        }

        return $hydrated;
    }