private static function clean($doc)
    {
        if ($doc === null) {
            return null;
        }

        $result = null;
        $lines = preg_split('/\r/', $doc);
        foreach ($lines as $line) {

            $line = preg_replace('/^\s*\* /', '', trim($line, "\n/* \t\x0B\0"));
            if ($line === '') {
                continue;
            }

            if ($result != null) {
                $result .= ' ';
            }
            $result .= $line;
        }

        return $result;
    }