class ServiceProviderTestServiceProvider
Same name in other branches
- 9 core/modules/system/tests/modules/service_provider_test/src/ServiceProviderTestServiceProvider.php \Drupal\service_provider_test\ServiceProviderTestServiceProvider
- 10 core/modules/system/tests/modules/service_provider_test/src/ServiceProviderTestServiceProvider.php \Drupal\service_provider_test\ServiceProviderTestServiceProvider
- 11.x core/modules/system/tests/modules/service_provider_test/src/ServiceProviderTestServiceProvider.php \Drupal\service_provider_test\ServiceProviderTestServiceProvider
Hierarchy
- class \Drupal\service_provider_test\ServiceProviderTestServiceProvider implements \Drupal\Core\DependencyInjection\ServiceModifierInterface
Expanded class hierarchy of ServiceProviderTestServiceProvider
File
-
core/
modules/ system/ tests/ modules/ service_provider_test/ src/ ServiceProviderTestServiceProvider.php, line 9
Namespace
Drupal\service_provider_testView source
class ServiceProviderTestServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if ($container->has('file.usage')) {
// Override the class used for the file.usage service.
$definition = $container->getDefinition('file.usage');
$definition->setClass('Drupal\\service_provider_test\\TestFileUsage');
}
if ($indicator = Settings::get('deployment_identifier')) {
$container->setParameter('container_rebuild_indicator', $indicator);
}
if ($parameter = Settings::get('container_rebuild_test_parameter')) {
$container->setParameter('container_rebuild_test_parameter', $parameter);
}
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ServiceProviderTestServiceProvider::alter | public | function | Modifies existing service definitions. | Overrides ServiceModifierInterface::alter |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.