Skip to content

Commit 0eb8dbf

Browse files
Merge branch '3.2' into 3.3
* 3.2: [DI] Resolve aliases earlier [DI] Mark Container::$privates as internal bumped Symfony version to 3.2.13 updated VERSION for 3.2.12 updated CHANGELOG for 3.2.12 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 4d5a306 + f6610aa commit 0eb8dbf

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

Container.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ class Container implements ResettableContainerInterface
5656

5757
protected $services = array();
5858
protected $methodMap = array();
59-
protected $privates = array();
6059
protected $aliases = array();
6160
protected $loading = array();
6261

62+
/**
63+
* @internal
64+
*/
65+
protected $privates = array();
66+
6367
/**
6468
* @internal
6569
*/
@@ -221,15 +225,15 @@ public function has($id)
221225
if (isset($this->privates[$id])) {
222226
@trigger_error(sprintf('Checking for the existence of the "%s" private service is deprecated since Symfony 3.2 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
223227
}
224-
if ('service_container' === $id) {
225-
return true;
226-
}
227228
if (isset($this->aliases[$id])) {
228229
$id = $this->aliases[$id];
229230
}
230231
if (isset($this->services[$id])) {
231232
return true;
232233
}
234+
if ('service_container' === $id) {
235+
return true;
236+
}
233237

234238
if (isset($this->methodMap[$id])) {
235239
return true;
@@ -279,9 +283,6 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
279283
if (isset($this->privates[$id])) {
280284
@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);
281285
}
282-
if ('service_container' === $id) {
283-
return $this;
284-
}
285286
if (isset($this->aliases[$id])) {
286287
$id = $this->aliases[$id];
287288
}
@@ -290,6 +291,9 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
290291
if (isset($this->services[$id])) {
291292
return $this->services[$id];
292293
}
294+
if ('service_container' === $id) {
295+
return $this;
296+
}
293297

294298
if (isset($this->loading[$id])) {
295299
throw new ServiceCircularReferenceException($id, array_keys($this->loading));
@@ -352,14 +356,14 @@ public function initialized($id)
352356
{
353357
$id = $this->normalizeId($id);
354358

355-
if ('service_container' === $id) {
356-
return false;
357-
}
358-
359359
if (isset($this->aliases[$id])) {
360360
$id = $this->aliases[$id];
361361
}
362362

363+
if ('service_container' === $id) {
364+
return false;
365+
}
366+
363367
return isset($this->services[$id]);
364368
}
365369

Dumper/PhpDumper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,10 @@ private function dumpParameter($name)
15921592
*/
15931593
private function getServiceCall($id, Reference $reference = null)
15941594
{
1595+
while ($this->container->hasAlias($id)) {
1596+
$id = (string) $this->container->getAlias($id);
1597+
}
1598+
15951599
if ('service_container' === $id) {
15961600
return '$this';
15971601
}

0 commit comments

Comments
 (0)