You are here

protected function JsMinifier::getFunction in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 advagg_js_minify/src/Asset/JsMinifier.php \Drupal\advagg_js_minify\Asset\JsMinifier::getFunction()

Get the function to use.

Parameters

int $minifier: Configuration value.

Return value

callable the callable to minify the contents.

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

File

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

Class

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