Jarves\Extractor\ClassExtractor::cleanDocComment PHP Method

cleanDocComment() public method

public cleanDocComment ( $comment )
    public function cleanDocComment($comment)
    {
        //start
        $comment = preg_replace('/^\\s*\\/\\*\\*$/mu', '', $comment);
        $comment = preg_replace('/^\\s*\\/\\*\\s*/m', '', $comment);
        $comment = trim($comment);
        //detect how much spaces need to be removed
        preg_match('/^\\s*\\*([ \\t]*)/', $comment, $matches);
        $cut = 0;
        if (isset($matches[1])) {
            $cut = strlen($matches[1]);
        }
        //middle
        // {' . $cut . '}
        $comment = preg_replace('/^[ \\t]*\\*[ \\t]{' . $cut . '}/m', '', $comment);
        $comment = preg_replace('/^[ \\t]*\\*$/m', '', $comment);
        //end
        $comment = preg_replace('/^\\s*\\*\\//mu', '', $comment);
        return rtrim($comment);
    }