You are here

public function CssOptimizer::__construct in Drupal 9

Constructs a CssOptimizer.

Parameters

\Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator: The file URL generator.

File

core/lib/Drupal/Core/Asset/CssOptimizer.php, line 34

Class

CssOptimizer
Optimizes a CSS asset.

Namespace

Drupal\Core\Asset

Code

public function __construct(FileUrlGeneratorInterface $file_url_generator = NULL) {
  if (!$file_url_generator) {
    @trigger_error('Calling CssOptimizer::__construct() without the $file_url_generator argument is deprecated in drupal:9.3.0. The $file_url_generator argument will be required in drupal:10.0.0. See https://www.drupal.org/node/2940031', E_USER_DEPRECATED);
    $file_url_generator = \Drupal::service('file_url_generator');
  }
  $this->fileUrlGenerator = $file_url_generator;
}