Skip to content

Commit f6610aa

Browse files
Merge branch '2.8' into 3.2
* 2.8: [DI] Resolve aliases earlier bumped Symfony version to 2.8.26 updated VERSION for 2.8.25 updated CHANGELOG for 2.8.25 bumped Symfony version to 2.7.33 updated VERSION for 2.7.32 update CONTRIBUTORS for 2.7.32 updated CHANGELOG for 2.7.32
2 parents 74f3d56 + 4cbe192 commit f6610aa

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Container.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
253253
if (isset($this->privates[$id])) {
254254
@trigger_error(sprintf('Requesting the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
255255
}
256-
if ('service_container' === $id) {
257-
return $this;
258-
}
259256
if (isset($this->aliases[$id])) {
260257
$id = $this->aliases[$id];
261258
}
@@ -264,6 +261,9 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
264261
if (isset($this->services[$id])) {
265262
return $this->services[$id];
266263
}
264+
if ('service_container' === $id) {
265+
return $this;
266+
}
267267

268268
if (isset($this->loading[$id])) {
269269
throw new ServiceCircularReferenceException($id, array_keys($this->loading));
@@ -326,14 +326,14 @@ public function initialized($id)
326326
{
327327
$id = strtolower($id);
328328

329-
if ('service_container' === $id) {
330-
return false;
331-
}
332-
333329
if (isset($this->aliases[$id])) {
334330
$id = $this->aliases[$id];
335331
}
336332

333+
if ('service_container' === $id) {
334+
return false;
335+
}
336+
337337
return isset($this->services[$id]);
338338
}
339339

Dumper/PhpDumper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,10 @@ private function dumpParameter($name)
14821482
*/
14831483
private function getServiceCall($id, Reference $reference = null)
14841484
{
1485+
while ($this->container->hasAlias($id)) {
1486+
$id = (string) $this->container->getAlias($id);
1487+
}
1488+
14851489
if ('service_container' === $id) {
14861490
return '$this';
14871491
}
@@ -1495,10 +1499,6 @@ private function getServiceCall($id, Reference $reference = null)
14951499
return sprintf('$this->get(\'%s\', ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id);
14961500
}
14971501

1498-
if ($this->container->hasAlias($id)) {
1499-
$id = (string) $this->container->getAlias($id);
1500-
}
1501-
15021502
return sprintf('$this->get(\'%s\')', $id);
15031503
}
15041504

0 commit comments

Comments
 (0)