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

php-cs-fixer fix

This commit is contained in:
Elan Ruusamäe
2017-04-18 18:24:17 +03:00
parent b6e4b7f152
commit 80c01c6f02
7 changed files with 11 additions and 4 deletions

View File

@@ -217,6 +217,7 @@ class Minify_CSS_Compressor
if (preg_match($pattern, $m, $n)) {
// end hack mode after this comment, but preserve the hack and comment content
$this->_inHack = false;
return "/*/{$n[1]}/**/";
}
}
@@ -224,18 +225,21 @@ class Minify_CSS_Compressor
if (substr($m, -1) === '\\') { // comment ends like \*/
// begin hack mode and preserve hack
$this->_inHack = true;
return '/*\\*/';
}
if ($m !== '' && $m[0] === '/') { // comment looks like /*/ foo */
// begin hack mode and preserve hack
$this->_inHack = true;
return '/*/*/';
}
if ($this->_inHack) {
// a regular comment ends hack mode but should be preserved
$this->_inHack = false;
return '/**/';
}

View File

@@ -52,7 +52,6 @@ class Minify_CSS_UriRewriter
// normalize symlinks in order to map to link
foreach ($symlinks as $link => $target) {
$link = ($link === '//') ? self::$_docRoot : str_replace('//', self::$_docRoot . '/', $link);
$link = strtr($link, '/', DIRECTORY_SEPARATOR);
@@ -272,6 +271,7 @@ class Minify_CSS_UriRewriter
\\s*
\\) # )
/x';
return preg_replace($pattern, 'url($1)', $css);
}
@@ -337,6 +337,7 @@ class Minify_CSS_UriRewriter
private static function _owlifySvgPaths($css)
{
$pattern = '~\b((?:clip-path|mask|-webkit-mask)\s*\:\s*)url(\(\s*#\w+\s*\))~';
return preg_replace($pattern, '$1owl$2', $css);
}
@@ -351,6 +352,7 @@ class Minify_CSS_UriRewriter
private static function _unOwlify($css)
{
$pattern = '~\b((?:clip-path|mask|-webkit-mask)\s*\:\s*)owl~';
return preg_replace($pattern, '$1url', $css);
}
}