comparison core/modules/rest/src/RestServiceProvider.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
5 use Drupal\Core\DependencyInjection\ContainerBuilder; 5 use Drupal\Core\DependencyInjection\ContainerBuilder;
6 use Drupal\Core\DependencyInjection\ServiceProviderInterface; 6 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
7 use Drupal\rest\LinkManager\LinkManager; 7 use Drupal\rest\LinkManager\LinkManager;
8 use Drupal\rest\LinkManager\RelationLinkManager; 8 use Drupal\rest\LinkManager\RelationLinkManager;
9 use Drupal\rest\LinkManager\TypeLinkManager; 9 use Drupal\rest\LinkManager\TypeLinkManager;
10 use Symfony\Component\DependencyInjection\DefinitionDecorator; 10 use Symfony\Component\DependencyInjection\ChildDefinition;
11 use Symfony\Component\DependencyInjection\Reference; 11 use Symfony\Component\DependencyInjection\Reference;
12 12
13 /** 13 /**
14 * Provides BC services. 14 * Provides BC services.
15 * 15 *
26 $modules = $container->getParameter(('container.modules')); 26 $modules = $container->getParameter(('container.modules'));
27 if (isset($modules['hal'])) { 27 if (isset($modules['hal'])) {
28 // @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. 28 // @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
29 // Use hal.link_manager instead. 29 // Use hal.link_manager instead.
30 // @see https://www.drupal.org/node/2830467 30 // @see https://www.drupal.org/node/2830467
31 $service_definition = new DefinitionDecorator(new Reference('hal.link_manager')); 31 $service_definition = new ChildDefinition(new Reference('hal.link_manager'));
32 $service_definition->setClass(LinkManager::class); 32 $service_definition->setClass(LinkManager::class);
33 $container->setDefinition('rest.link_manager', $service_definition); 33 $container->setDefinition('rest.link_manager', $service_definition);
34 34
35 // @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. 35 // @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
36 // Use hal.link_manager.type instead. 36 // Use hal.link_manager.type instead.
37 // @see https://www.drupal.org/node/2830467 37 // @see https://www.drupal.org/node/2830467
38 $service_definition = new DefinitionDecorator(new Reference('hal.link_manager.type')); 38 $service_definition = new ChildDefinition(new Reference('hal.link_manager.type'));
39 $service_definition->setClass(TypeLinkManager::class); 39 $service_definition->setClass(TypeLinkManager::class);
40 $container->setDefinition('rest.link_manager.type', $service_definition); 40 $container->setDefinition('rest.link_manager.type', $service_definition);
41 41
42 // @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0. 42 // @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
43 // Use hal.link_manager.relation instead. 43 // Use hal.link_manager.relation instead.
44 // @see https://www.drupal.org/node/2830467 44 // @see https://www.drupal.org/node/2830467
45 $service_definition = new DefinitionDecorator(new Reference('hal.link_manager.relation')); 45 $service_definition = new ChildDefinition(new Reference('hal.link_manager.relation'));
46 $service_definition->setClass(RelationLinkManager::class); 46 $service_definition->setClass(RelationLinkManager::class);
47 $container->setDefinition('rest.link_manager.relation', $service_definition); 47 $container->setDefinition('rest.link_manager.relation', $service_definition);
48 } 48 }
49 } 49 }
50 50