1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-14 01:54:11 +02:00

Big style cleanup

This commit is contained in:
Steve Clay
2016-10-16 15:13:38 -04:00
parent 5fb7ea1ed1
commit 16c811cd93
23 changed files with 257 additions and 266 deletions

View File

@@ -72,21 +72,16 @@ class Minify_CommentPreserver
*/
private static function _nextComment($in)
{
if (
false === ($start = strpos($in, '/*!'))
|| false === ($end = strpos($in, '*/', $start + 3))
) {
if (false === ($start = strpos($in, '/*!')) || false === ($end = strpos($in, '*/', $start + 3))) {
return array($in, false, false);
}
$ret = array(
substr($in, 0, $start)
,self::$prepend . '/*!' . substr($in, $start + 3, $end - $start - 1) . self::$append
);
$endChars = (strlen($in) - $end - 2);
$ret[] = (0 === $endChars)
? ''
: substr($in, -$endChars);
return $ret;
$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);
}
}