# wp-super-minify/trunk/includes/min/lib/Minify/JS/JShrink.php

WP Super Minify • Minify, Compress and Cache HTML, CSS &amp; JavaScript, version trunk. 49 lines.

- Page: https://pluginprobe.com/plugins/wp-super-minify/trunk/code/includes/min/lib/Minify/JS/JShrink.php
- Raw: https://pluginprobe.com/plugins/wp-super-minify/trunk/raw/includes/min/lib/Minify/JS/JShrink.php
- Modified: 2025-02-16T14:33:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-super-minify/trunk/code/includes/min/lib/Minify/JS/JShrink.php#L10-L20`.

```php
<?php
/**
 * Class Minify\JS\JShrink
 *
 * @package Minify
 */

namespace Minify\JS;

/**
 * Wrapper to Javascript Minifier built in PHP http://www.tedivm.com
 *
 * @package Minify
 * @author  Elan Ruusamäe <glen@pld-linux.org>
 * @link    https://github.com/tedious/JShrink
 *
 */
class JShrink
{
    /**
     * Contains the default options for minification. This array is merged with
     * the one passed in by the user to create the request specific set of
     * options (stored in the $options attribute).
     *
     * @var string[]
     */
    protected static $defaultOptions = array('flaggedComments' => true);

    /**
     * Takes a string containing javascript and removes unneeded characters in
     * order to shrink the code without altering it's functionality.
     *
     * @param  string $js      The raw javascript to be minified
     * @param  array  $options Various runtime options in an associative array
     *
     * @see JShrink\Minifier::minify()
     * @return string
     */
    public static function minify($js, array $options = array())
    {
        $options = array_merge(
            self::$defaultOptions,
            $options
        );

        return \JShrink\Minifier::minify($js, $options);
    }
}

```
