X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FDependencyInjection%2FContainerBuilder.php;h=9f510781fbb553b632f5df1056200ae29e68413e;hb=refs%2Fheads%2Fd864;hp=e0becc71e22f5e4a1f40e0d8736fe48a249cfc29;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php b/web/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php index e0becc71e..9f510781f 100644 --- a/web/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php +++ b/web/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php @@ -27,8 +27,8 @@ class ContainerBuilder extends SymfonyContainerBuilder { * {@inheritdoc} */ public function __construct(ParameterBagInterface $parameterBag = NULL) { - $this->setResourceTracking(FALSE); parent::__construct($parameterBag); + $this->setResourceTracking(FALSE); } /** @@ -46,9 +46,12 @@ class ContainerBuilder extends SymfonyContainerBuilder { } /** - * {@inheritdoc} + * A 1to1 copy of parent::shareService. + * + * @todo https://www.drupal.org/project/drupal/issues/2937010 Since Symfony + * 3.4 this is not a 1to1 copy. */ - protected function shareService(Definition $definition, $service, $id) + protected function shareService(Definition $definition, $service, $id, array &$inlineServices) { if ($definition->isShared()) { $this->services[$lowerId = strtolower($id)] = $service; @@ -88,6 +91,32 @@ class ContainerBuilder extends SymfonyContainerBuilder { return parent::register($id, $class); } + /** + * {@inheritdoc} + */ + public function setAlias($alias, $id) { + $alias = parent::setAlias($alias, $id); + // As of Symfony 3.4 all aliases are private by default. + $alias->setPublic(TRUE); + return $alias; + } + + /** + * {@inheritdoc} + */ + public function setDefinition($id, Definition $definition) { + $definition = parent::setDefinition($id, $definition); + // As of Symfony 3.4 all definitions are private by default. + // \Symfony\Component\DependencyInjection\Compiler\ResolvePrivatesPassOnly + // removes services marked as private from the container even if they are + // also marked as public. Drupal requires services that are public to + // remain in the container and not be removed. + if ($definition->isPublic()) { + $definition->setPrivate(FALSE); + } + return $definition; + } + /** * {@inheritdoc} */ @@ -100,8 +129,11 @@ class ContainerBuilder extends SymfonyContainerBuilder { /** * A 1to1 copy of parent::callMethod. + * + * @todo https://www.drupal.org/project/drupal/issues/2937010 Since Symfony + * 3.4 this is not a 1to1 copy. */ - protected function callMethod($service, $call) { + protected function callMethod($service, $call, array &$inlineServices = array()) { $services = self::getServiceConditionals($call[1]); foreach ($services as $s) {