You are here

private function CssOptimizer::getFileUrlGenerator in Drupal 9

Returns the file URL generator.

This is provided for BC as sub-classes may not call the parent constructor.

@internal This can be removed in Drupal 10.0.x when the constructor deprecation is removed.

Return value

\Drupal\Core\File\FileUrlGeneratorInterface The file URL generator.

File

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

Class

CssOptimizer
Optimizes a CSS asset.

Namespace

Drupal\Core\Asset

Code

private function getFileUrlGenerator() : FileUrlGeneratorInterface {
  if (!$this->fileUrlGenerator) {
    @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);
    $this->fileUrlGenerator = \Drupal::service('file_url_generator');
  }
  return $this->fileUrlGenerator;
}