1
0
mirror of https://github.com/mrclay/minify.git synced 2025-07-31 03:10:09 +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

@@ -517,7 +517,6 @@ class Minify
if ($file
&& !isset($minifyOptions['currentDir'])
&& !isset($minifyOptions['prependRelativePath'])) {
$minifyOptions['currentDir'] = dirname($file);
$source->setMinifierOptions($minifyOptions);
}

View File

@@ -89,6 +89,7 @@ class Minify_CSS
$currentDir = $options['currentDir'];
$docRoot = $options['docRoot'];
$symlinks = $options['symlinks'];
return Minify_CSS_UriRewriter::rewrite($css, $currentDir, $docRoot, $symlinks);
} else {
return Minify_CSS_UriRewriter::prepend($css, $options['prependRelativePath']);

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);
}
}

View File

@@ -62,7 +62,7 @@ class Minify_Cache_APC implements Minify_CacheInterface
if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
return mb_strlen($this->_data, '8bit');
} else {
return strlen($this->_data);;
return strlen($this->_data);
}
}
@@ -124,6 +124,7 @@ class Minify_Cache_APC implements Minify_CacheInterface
$ret = apc_fetch($id);
if (false === $ret) {
$this->_id = null;
return false;
}

View File

@@ -109,6 +109,7 @@ class Minify_Cache_File implements Minify_CacheInterface
{
if (!$this->locking) {
readfile($this->path . '/' . $id);
return;
}

View File

@@ -208,7 +208,6 @@ class Minify_Source implements Minify_SourceInterface
if ($this->filepath
&& !isset($this->minifyOptions['currentDir'])
&& !isset($this->minifyOptions['prependRelativePath'])) {
$this->minifyOptions['currentDir'] = dirname($this->filepath);
}
}