Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.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 |
---|---|
25 | 25 |
26 /** | 26 /** |
27 * {@inheritdoc} | 27 * {@inheritdoc} |
28 */ | 28 */ |
29 public function __construct(ParameterBagInterface $parameterBag = NULL) { | 29 public function __construct(ParameterBagInterface $parameterBag = NULL) { |
30 parent::__construct($parameterBag); | |
30 $this->setResourceTracking(FALSE); | 31 $this->setResourceTracking(FALSE); |
31 parent::__construct($parameterBag); | |
32 } | 32 } |
33 | 33 |
34 /** | 34 /** |
35 * Retrieves the currently set proxy instantiator or instantiates one. | 35 * Retrieves the currently set proxy instantiator or instantiates one. |
36 * | 36 * |
44 | 44 |
45 return $this->proxyInstantiator; | 45 return $this->proxyInstantiator; |
46 } | 46 } |
47 | 47 |
48 /** | 48 /** |
49 * {@inheritdoc} | 49 * A 1to1 copy of parent::shareService. |
50 * | |
51 * @todo https://www.drupal.org/project/drupal/issues/2937010 Since Symfony | |
52 * 3.4 this is not a 1to1 copy. | |
50 */ | 53 */ |
51 protected function shareService(Definition $definition, $service, $id) | 54 protected function shareService(Definition $definition, $service, $id, array &$inlineServices) |
52 { | 55 { |
53 if ($definition->isShared()) { | 56 if ($definition->isShared()) { |
54 $this->services[$lowerId = strtolower($id)] = $service; | 57 $this->services[$lowerId = strtolower($id)] = $service; |
55 } | 58 } |
56 } | 59 } |
89 } | 92 } |
90 | 93 |
91 /** | 94 /** |
92 * {@inheritdoc} | 95 * {@inheritdoc} |
93 */ | 96 */ |
97 public function setAlias($alias, $id) { | |
98 $alias = parent::setAlias($alias, $id); | |
99 // As of Symfony 3.4 all aliases are private by default. | |
100 $alias->setPublic(TRUE); | |
101 return $alias; | |
102 } | |
103 | |
104 /** | |
105 * {@inheritdoc} | |
106 */ | |
107 public function setDefinition($id, Definition $definition) { | |
108 $definition = parent::setDefinition($id, $definition); | |
109 // As of Symfony 3.4 all definitions are private by default. | |
110 // \Symfony\Component\DependencyInjection\Compiler\ResolvePrivatesPassOnly | |
111 // removes services marked as private from the container even if they are | |
112 // also marked as public. Drupal requires services that are public to | |
113 // remain in the container and not be removed. | |
114 if ($definition->isPublic()) { | |
115 $definition->setPrivate(FALSE); | |
116 } | |
117 return $definition; | |
118 } | |
119 | |
120 /** | |
121 * {@inheritdoc} | |
122 */ | |
94 public function setParameter($name, $value) { | 123 public function setParameter($name, $value) { |
95 if (strtolower($name) !== $name) { | 124 if (strtolower($name) !== $name) { |
96 throw new \InvalidArgumentException("Parameter names must be lowercase: $name"); | 125 throw new \InvalidArgumentException("Parameter names must be lowercase: $name"); |
97 } | 126 } |
98 parent::setParameter($name, $value); | 127 parent::setParameter($name, $value); |
99 } | 128 } |
100 | 129 |
101 /** | 130 /** |
102 * A 1to1 copy of parent::callMethod. | 131 * A 1to1 copy of parent::callMethod. |
132 * | |
133 * @todo https://www.drupal.org/project/drupal/issues/2937010 Since Symfony | |
134 * 3.4 this is not a 1to1 copy. | |
103 */ | 135 */ |
104 protected function callMethod($service, $call) { | 136 protected function callMethod($service, $call, array &$inlineServices = array()) { |
105 $services = self::getServiceConditionals($call[1]); | 137 $services = self::getServiceConditionals($call[1]); |
106 | 138 |
107 foreach ($services as $s) { | 139 foreach ($services as $s) { |
108 if (!$this->has($s)) { | 140 if (!$this->has($s)) { |
109 return; | 141 return; |