You are here

public function SophronGuesserServiceProvider::alter in Sophron 8

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

sophron_guesser/src/SophronGuesserServiceProvider.php, line 17

Class

SophronGuesserServiceProvider
Modifies the "file.mime_type.guesser.extension" service.

Namespace

Drupal\sophron_guesser

Code

public function alter(ContainerBuilder $container) {

  // Overrides "file.mime_type.guesser.extension" to use Sophron.
  $definition = $container
    ->getDefinition('file.mime_type.guesser.extension');
  $definition
    ->setClass(SophronMimeTypeGuesser::class)
    ->setArguments([
    new Reference('sophron.mime_map.manager'),
    new Reference('file_system'),
  ]);
}