Skip to content

Commit c09a269

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: [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 7b78523 + f90551b commit c09a269

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
@@ -734,7 +734,7 @@ private function addServiceMethodCalls(Definition $definition, string $variableN
734734
$witherAssignation = '';
735735

736736
if ($call[2] ?? false) {
737-
if (null !== $sharedNonLazyId && $lastWitherIndex === $k) {
737+
if (null !== $sharedNonLazyId && $lastWitherIndex === $k && 'instance' === $variableName) {
738738
$witherAssignation = sprintf('$this->%s[\'%s\'] = ', $definition->isPublic() ? 'services' : 'privates', $sharedNonLazyId);
739739
}
740740
$witherAssignation .= sprintf('$%s = ', $variableName);

Tests/Dumper/PhpDumperTest.php

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

14101411
$container
14111412
->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)