Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit da1175c

Browse filesBrowse files
Merge branch '3.4' into 4.1
* 3.4: [DI] fix dumping lazy services
2 parents 4879a75 + 8877a33 commit da1175c
Copy full SHA for da1175c

File tree

Expand file treeCollapse file tree

2 files changed

+10
-28
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-28
lines changed

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function dump(array $options = array())
155155
}
156156
}
157157

158-
(new AnalyzeServiceReferencesPass(false, !$this->getProxyDumper() instanceof NullDumper))->process($this->container);
158+
(new AnalyzeServiceReferencesPass(false))->process($this->container);
159159
$this->circularReferences = array();
160160
$checkedNodes = array();
161161
foreach ($this->container->getCompiler()->getServiceReferenceGraph()->getNodes() as $id => $node) {

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php
+9-27Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,11 @@ protected function getBar5Service()
138138
*/
139139
protected function getConnectionService()
140140
{
141-
$a = ($this->services['dispatcher'] ?? $this->getDispatcherService());
142-
143-
if (isset($this->services['connection'])) {
144-
return $this->services['connection'];
145-
}
146-
147-
$b = new \stdClass();
141+
$a = new \stdClass();
148142

149-
$this->services['connection'] = $instance = new \stdClass($a, $b);
143+
$this->services['connection'] = $instance = new \stdClass(($this->services['dispatcher'] ?? $this->getDispatcherService()), $a);
150144

151-
$b->logger = ($this->services['logger'] ?? $this->getLoggerService());
145+
$a->logger = ($this->services['logger'] ?? $this->getLoggerService());
152146

153147
return $instance;
154148
}
@@ -160,21 +154,15 @@ protected function getConnectionService()
160154
*/
161155
protected function getConnection2Service()
162156
{
163-
$a = ($this->services['dispatcher2'] ?? $this->getDispatcher2Service());
164-
165-
if (isset($this->services['connection2'])) {
166-
return $this->services['connection2'];
167-
}
168-
169-
$b = new \stdClass();
157+
$a = new \stdClass();
170158

171-
$this->services['connection2'] = $instance = new \stdClass($a, $b);
159+
$this->services['connection2'] = $instance = new \stdClass(($this->services['dispatcher2'] ?? $this->getDispatcher2Service()), $a);
172160

173-
$c = new \stdClass($instance);
161+
$b = new \stdClass($instance);
174162

175-
$c->handler2 = new \stdClass(($this->services['manager2'] ?? $this->getManager2Service()));
163+
$b->handler2 = new \stdClass(($this->services['manager2'] ?? $this->getManager2Service()));
176164

177-
$b->logger2 = $c;
165+
$a->logger2 = $b;
178166

179167
return $instance;
180168
}
@@ -384,12 +372,6 @@ protected function getManager2Service()
384372
*/
385373
protected function getSubscriberService()
386374
{
387-
$a = ($this->services['manager'] ?? $this->getManagerService());
388-
389-
if (isset($this->services['subscriber'])) {
390-
return $this->services['subscriber'];
391-
}
392-
393-
return $this->services['subscriber'] = new \stdClass($a);
375+
return $this->services['subscriber'] = new \stdClass(($this->services['manager'] ?? $this->getManagerService()));
394376
}
395377
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.