minify css
@param string $v
@return string
503476
protected static function minify($v) {
        $v = trim($v);
        $v = str_replace("\r\n", "\n", $v);
        $search = array("/\/\*[\d\D]*?\*\/|\t+/", "/\s+/", "/\}\s+/");
        $replace = array(null, " ", "}\n");
        $v = preg_replace($search, $replace, $v);
        $search = array("/\\;\s/", "/\s+\{\\s+/", "/\\:\s+\\#/", "/,\s+/i", "/\\:\s+\\\'/i", "/\\:\s+([0-9]+|[A-F]+)/i");
        $replace = array(";", "{", ":#", ",", ":\'", ":$1");
        $v = preg_replace($search, $replace, $v);
        $v = str_replace("\n", null, $v);
        return $v;
    }
1310606
public static function minifyString( $string )
	{
		$string = str_replace( PHP_EOL , ' ' , $string );
		$string = preg_replace( '/[\r\n]+/' , "\n" , $string );

		return preg_replace( '/[ \t]+/' , ' ' , $string );
	}
2192
function minify(src) {
       // remove comments
       src = src.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, "$1"); // Remove leading and trailing whitespace from lines

       src = src.replace(/(\\n\s+)|(\s+\\n)/g, ""); // Remove line breaks

       src = src.replace(/(\\r|\\n)+/g, ""); // Remove unnecessary whitespace

       src = src.replace(/\s*([;,[\](){}\\\/\-+*|^&!=<>?~%])\s*/g, "$1");
       return src;
     }
246555
public static function minify($source, array $filters = null, array $plugins = null)
		{
		self::$errors = array();
		$minifier = new CssMinifier($source, $filters, $plugins);
		return $minifier->getMinified();
		}
962830
def minify(asset, format)
      asset = asset.to_s
      # Minify JS
      return Uglifier.compile(asset) if format.eql?("js")
      # Minify CSS
      return YUI::CssCompressor.new.compress(asset) if format.eql?("css")
      # Return string representation if not minimizing
      return asset
    end
821470
public function setWidth($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->width !== $v) {
            $this->width = $v;
            $this->modifiedColumns[MediaTableMap::COL_WIDTH] = true;
        }

        return $this;
    }
1056091
public function packFloat($v)
    {
        $str = chr(Constants::MARKER_FLOAT);

        return $str.strrev(pack('d', $v));
    }
1309390
function css($css, $media = null, $condition = null, $no_build = false) {
        $this->css[$css] = compact('media', 'condition', 'no_build');
        
        return $this;
    }
201366
protected function minify($html)
    {
        $html = str_replace('<?xml encoding="UTF-8">', '', $html);

        $html = trim(preg_replace('/\s+/', ' ', $html));

        $html = str_replace('> <', '><', $html);

        return str_replace(array(' />', '/>'), '>', $html);
    }
1047381
final public static function fontawesomeless(array $params)
    {
        return ("<link href='".FEnv::get("host.web.components")."libs/font-awesome/less/".
            ((isset($params['name']))? $params['name'].".".
                ((isset($params['min']) && $params['min'] == "yes")? "min"."." : "") : "")."less' rel='stylesheet' />");
    }
172162
public function setThumbsize($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->thumbsize !== $v) {
            $this->thumbsize = $v;
            $this->modifiedColumns[MediaTableMap::COL_THUMBSIZE] = true;
        }

        return $this;
    }
613860
public static function minify($string, $noSpace = false)
    {
        $string = preg_replace("/\s+/", ' ', $string);
        return $noSpace ? str_replace(' ', '', $string) : $string;
    }
579529
public function minify($htmlText = "")
    {
        if ($this->shouldMinify) {
            $options = [
                'cssMinifier' => '\Minify_CSSmin::minify',
                'jsMinifier' => '\JSMin\JSMin::minify',
            ];
            $htmlText = \Minify_HTML::minify($htmlText, $options);
        }

        return $htmlText;
    }
466696
protected function minifyAttribute($match)
    {
        if (Str::contains($match[2], $this->prohibitedChars)) {
            return $match[0];
        } elseif (preg_match('/'.Constants::PLACEHOLDER_PATTERN.'/is', $match[2])) {
            return $match[0];
        }

        return '='.$match[2];
    }
835720
public function setMinify($minify)
    {
        $this->pug->setKeyword('assets', $minify);
        $this->pug->setKeyword('concat', $minify);
        $this->pug->setKeyword('concat-to', $minify);
        $this->pug->setKeyword('minify', $minify);
        $this->pug->setKeyword('minify-to', $minify);
        $this->minify = $minify;

        return $this;
    }
1163360
protected function minify($code)
    {
        $pattern = (string) '!/\*[^*]*\*+([^/][^*]*\*+)*/!';

        $minified = preg_replace('/^\\s+/m', '', $code);

        $minified = preg_replace($pattern, '', $minified);

        $minified = preg_replace('/( )?}( )?/', '}', $minified);

        $minified = preg_replace('/( )?{( )?/', '{', $minified);

        $minified = preg_replace('/( )?:( )?/', ':', $minified);

        $minified = preg_replace('/( )?;( )?/', ';', $minified);

        $minified = preg_replace('/( )?,( )?/', ',', $minified);

        return $minified;
    }
1045181
protected function minifyContent($type, $content)
    {
        $minifier = null;
        if ($type === AssetManager::CSS) {
            $minifier = new \MatthiasMullie\Minify\CSS($content);
        } else if ($type === AssetManager::JS) {
            $minifier = new \MatthiasMullie\Minify\JS($content);
        }
        
        if ($minifier !== null) {
            return $minifier->minify();
        }
        
        return $content;
    }