Same name in other branches
  1. 6.0.x advagg_js_minify/src/Asset/JsMinifier.php \Drupal\advagg_js_minify\Asset\JsMinifier::getFunction()
  2. 8.x-3.x advagg_js_minify/src/Asset/JsMinifier.php \Drupal\advagg_js_minify\Asset\JsMinifier::getFunction()
  3. 8.x-4.x advagg_js_minify/src/Asset/JsMinifier.php \Drupal\advagg_js_minify\Asset\JsMinifier::getFunction()

Get the function to use.

Paramètres

int $minifier: Configuration value.

Return value

callable the callable to minify the contents.

1 call to JsMinifier::getFunction()
JsMinifier::optimize dans advagg_js_minify/src/Asset/JsMinifier.php
Optimize the asset's content.

Fichier

advagg_js_minify/src/Asset/JsMinifier.php, line 79

Classe

JsMinifier
Optimizes a JavaScript asset.

Namespace

Drupal\advagg_js_minify\Asset

Code

protected function getFunction($minifier) {
    $functions = [
        1 => [
            $this,
            'minifyJsminplus',
        ],
        2 => [
            $this,
            'minifyJspacker',
        ],
        3 => [
            $this,
            'minifyJsmin',
        ],
        4 => [
            $this,
            'minifyJshrink',
        ],
        5 => [
            $this,
            'minifyJsqueeze',
        ],
    ];
    return $functions[$minifier];
}