You are here

class FileServiceProvider in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/file/src/FileServiceProvider.php \Drupal\file\FileServiceProvider

Adds 'application/octet-stream' as a known (bin) format.

Hierarchy

Expanded class hierarchy of FileServiceProvider

File

core/modules/file/src/FileServiceProvider.php, line 12

Namespace

Drupal\file
View source
class FileServiceProvider implements ServiceModifierInterface {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    if ($container
      ->has('http_middleware.negotiation') && is_a($container
      ->getDefinition('http_middleware.negotiation')
      ->getClass(), NegotiationMiddleware::class, TRUE)) {
      $container
        ->getDefinition('http_middleware.negotiation')
        ->addMethodCall('registerFormat', [
        'bin',
        [
          'application/octet-stream',
        ],
      ]);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FileServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceModifierInterface::alter