Minify_CommentPreserver::_nextComment PHP Méthode

_nextComment() private static méthode

Extract comments that YUI Compressor preserves.
private static _nextComment ( string $in ) : array
$in string input
Résultat array 3 elements are returned. If a YUI comment is found, the 2nd element is the comment and the 1st and 3rd are the surrounding strings. If no comment is found, the entire string is returned as the 1st element and the other two are false.
    private static function _nextComment($in)
    {
        if (false === ($start = strpos($in, '/*!')) || false === ($end = strpos($in, '*/', $start + 3))) {
            return array($in, false, false);
        }
        $beforeComment = substr($in, 0, $start);
        $comment = self::$prepend . '/*!' . substr($in, $start + 3, $end - $start - 1) . self::$append;
        $endChars = strlen($in) - $end - 2;
        $afterComment = 0 === $endChars ? '' : substr($in, -$endChars);
        return array($beforeComment, $comment, $afterComment);
    }
Minify_CommentPreserver