Skip to content

Commit f90551b

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: [Yaml] Minor: Update Inline parse phpdoc [DependencyInjection] Fix dumping inlined withers [HttpClient] Move Http clients data collecting at a late level [FrameworkBundle] restore call to addGlobalIgnoredName Allow EmailValidator 4 Fix detecting mapping with one line annotations
2 parents d790df9 + 763f757 commit f90551b

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ private function addServiceMethodCalls(Definition $definition, string $variableN
743743
$witherAssignation = '';
744744

745745
if ($call[2] ?? false) {
746-
if (null !== $sharedNonLazyId && $lastWitherIndex === $k) {
746+
if (null !== $sharedNonLazyId && $lastWitherIndex === $k && 'instance' === $variableName) {
747747
$witherAssignation = sprintf('$this->%s[\'%s\'] = ', $definition->isPublic() ? 'services' : 'privates', $sharedNonLazyId);
748748
}
749749
$witherAssignation .= sprintf('$%s = ', $variableName);

Tests/Dumper/PhpDumperTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,8 @@ public function testAliasCanBeFoundInTheDumpedContainerWhenBothTheAliasAndTheSer
14041404
public function testWither()
14051405
{
14061406
$container = new ContainerBuilder();
1407-
$container->register(Foo::class);
1407+
$container->register(Foo::class)
1408+
->setAutowired(true);
14081409

14091410
$container
14101411
->register('wither', Wither::class)

Tests/Fixtures/includes/autowiring_classes.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313

1414
class Foo
1515
{
16+
/**
17+
* @required
18+
* @return static
19+
*/
20+
public function cloneFoo()
21+
{
22+
return clone $this;
23+
}
1624
}
1725

1826
class Bar

Tests/Fixtures/php/services_wither.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ protected function getWitherService()
5353
$instance = new \Symfony\Component\DependencyInjection\Tests\Compiler\Wither();
5454

5555
$a = new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo();
56+
$a = $a->cloneFoo();
5657

5758
$instance = $instance->withFoo1($a);
5859
$this->services['wither'] = $instance = $instance->withFoo2($a);

0 commit comments

Comments
 (0)