You are here

class SophronGuesserServiceProvider in Sophron 8

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

Hierarchy

Expanded class hierarchy of SophronGuesserServiceProvider

File

sophron_guesser/src/SophronGuesserServiceProvider.php, line 12

Namespace

Drupal\sophron_guesser
View source
class SophronGuesserServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  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'),
    ]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1
SophronGuesserServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceProviderBase::alter