class PathAliasDeprecatedTestServiceProvider in Drupal 8
Test service provider to test path alias deprecated services BC logic.
Hierarchy
- class \Drupal\path_alias_deprecated_test\PathAliasDeprecatedTestServiceProvider implements ServiceModifierInterface
Expanded class hierarchy of PathAliasDeprecatedTestServiceProvider
1 file declares its use of PathAliasDeprecatedTestServiceProvider
- DeprecatedServicesTest.php in core/
modules/ path_alias/ tests/ src/ Kernel/ DeprecatedServicesTest.php
File
- core/
modules/ path_alias/ tests/ modules/ path_alias_deprecated_test/ src/ PathAliasDeprecatedTestServiceProvider.php, line 11
Namespace
Drupal\path_alias_deprecated_testView source
class PathAliasDeprecatedTestServiceProvider implements ServiceModifierInterface {
/**
* The name of the new implementation class for the alias manager.
*
* @var string
*/
public static $newClass;
/**
* Whether to use a decorator to wrap the alias manager implementation.
*
* @var bool
*/
public static $useDecorator = FALSE;
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if (isset(static::$newClass)) {
$definition = $container
->getDefinition('path.alias_manager');
$definition
->setClass(static::$newClass);
}
if (!static::$useDecorator) {
$decorator_id = 'path_alias_deprecated_test.path.alias_manager';
if ($container
->hasDefinition($decorator_id)) {
$container
->removeDefinition($decorator_id);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PathAliasDeprecatedTestServiceProvider:: |
public static | property | The name of the new implementation class for the alias manager. | |
PathAliasDeprecatedTestServiceProvider:: |
public static | property | Whether to use a decorator to wrap the alias manager implementation. | |
PathAliasDeprecatedTestServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |