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 8b08888

Browse filesBrowse files
committed
bug #9812 [DependencyInjection] fix a regression introduced in #9807 (realityking)
This PR was merged into the 2.5-dev branch. Discussion ---------- [DependencyInjection] fix a regression introduced in #9807 | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As @stof pointed out in #9807 we always need to dump the fully qualified class name, to support dumping containers in a namespace. Commits ------- 0d78776 [DependencyInjection] fix a regression introduced in #9807
2 parents 11434de + 0d78776 commit 8b08888
Copy full SHA for 8b08888

File tree

Expand file treeCollapse file tree

3 files changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-6
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ private function addServiceConfigurator($id, $definition, $variableName = 'insta
490490
$class = $this->dumpValue($callable[0]);
491491
// If the class is a string we can optimize call_user_func away
492492
if (strpos($class, "'") === 0) {
493-
return sprintf(" %s::%s(\$%s);\n", substr($class, 1, -1), $callable[1], $variableName);
493+
return sprintf(" \%s::%s(\$%s);\n", substr($class, 1, -1), $callable[1], $variableName);
494494
}
495495

496496
return sprintf(" call_user_func(array(%s, '%s'), \$%s);\n", $this->dumpValue($callable[0]), $callable[1], $variableName);
@@ -701,7 +701,7 @@ private function addNewInstance($id, Definition $definition, $return, $instantia
701701

702702
// If the class is a string we can optimize call_user_func away
703703
if (strpos($class, "'") === 0) {
704-
return sprintf(" $return{$instantiation}%s::%s(%s);\n", substr($class, 1, -1), $definition->getFactoryMethod(), $arguments ? implode(', ', $arguments) : '');
704+
return sprintf(" $return{$instantiation}\%s::%s(%s);\n", substr($class, 1, -1), $definition->getFactoryMethod(), $arguments ? implode(', ', $arguments) : '');
705705
}
706706

707707
return sprintf(" $return{$instantiation}call_user_func(array(%s, '%s')%s);\n", $this->dumpValue($definition->getFactoryClass()), $definition->getFactoryMethod(), $arguments ? ', '.implode(', ', $arguments) : '');

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ protected function getFooService()
138138
{
139139
$a = $this->get('foo.baz');
140140

141-
$this->services['foo'] = $instance = FooClass::getInstance('foo', $a, array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'foobar' => $this->getParameter('foo')), true, $this);
141+
$this->services['foo'] = $instance = \FooClass::getInstance('foo', $a, array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'foobar' => $this->getParameter('foo')), true, $this);
142142

143143
$instance->setBar($this->get('bar'));
144144
$instance->initialize();

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function getFooService()
148148
{
149149
$a = $this->get('foo.baz');
150150

151-
$this->services['foo'] = $instance = FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
151+
$this->services['foo'] = $instance = \FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this);
152152

153153
$instance->setBar($this->get('bar'));
154154
$instance->initialize();
@@ -169,9 +169,9 @@ protected function getFooService()
169169
*/
170170
protected function getFoo_BazService()
171171
{
172-
$this->services['foo.baz'] = $instance = BazClass::getInstance();
172+
$this->services['foo.baz'] = $instance = \BazClass::getInstance();
173173

174-
BazClass::configureStatic1($instance);
174+
\BazClass::configureStatic1($instance);
175175

176176
return $instance;
177177
}

0 commit comments

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