Skip to content

Commit 763f757

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [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 6e36593 + e20cd83 commit 763f757

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
@@ -1396,7 +1396,8 @@ public function testAliasCanBeFoundInTheDumpedContainerWhenBothTheAliasAndTheSer
13961396
public function testWither()
13971397
{
13981398
$container = new ContainerBuilder();
1399-
$container->register(Foo::class);
1399+
$container->register(Foo::class)
1400+
->setAutowired(true);
14001401

14011402
$container
14021403
->register('wither', Wither::class)

Tests/Fixtures/includes/autowiring_classes.php

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

1616
class Foo
1717
{
18+
/**
19+
* @required
20+
* @return static
21+
*/
22+
public function cloneFoo()
23+
{
24+
return clone $this;
25+
}
1826
}
1927

2028
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)