You are here

public function BynderTestModuleServiceProvider::alter in Bynder 4.0.x

Same name and namespace in other branches
  1. 8.3 tests/modules/bynder_test_module/src/BynderTestModuleServiceProvider.php \Drupal\bynder_test_module\BynderTestModuleServiceProvider::alter()
  2. 8 tests/modules/bynder_test_module/src/BynderTestModuleServiceProvider.php \Drupal\bynder_test_module\BynderTestModuleServiceProvider::alter()
  3. 8.2 tests/modules/bynder_test_module/src/BynderTestModuleServiceProvider.php \Drupal\bynder_test_module\BynderTestModuleServiceProvider::alter()

Modifies existing service definitions.

Parameters

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

Overrides ServiceModifierInterface::alter

File

tests/modules/bynder_test_module/src/BynderTestModuleServiceProvider.php, line 17

Class

BynderTestModuleServiceProvider
Service provider for the bynder_test_module.

Namespace

Drupal\bynder_test_module

Code

public function alter(ContainerBuilder $container) {

  // Modifies the Bynder api service to use our test class.
  $container
    ->getDefinition('bynder_api')
    ->setClass('Drupal\\bynder_test_module\\BynderApiTest')
    ->setArguments([
    new Reference('config.factory'),
    new Reference('logger.factory'),
    new Reference('session'),
    new Reference('state'),
    new Reference('cache.default'),
    new Reference('datetime.time'),
  ]);
}