Skip to content

Commit cdaee34

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Routing] fix tests [Form] group constraints when calling the validator Remove wrong @group legacy annotations [DependencyInjection] Fix dumping multiple deprecated aliases allow button names to start with uppercase letter States that the HttpClient provides a Http Async implementation
2 parents dc6ef80 + d443981 commit cdaee34

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ private function addDeprecatedAliases(): string
13021302
$methodNameAlias = $this->generateMethodName($alias);
13031303
$idExported = $this->export($id);
13041304
$messageExported = $this->export($definition->getDeprecationMessage($alias));
1305-
$code = <<<EOF
1305+
$code .= <<<EOF
13061306
13071307
/*{$this->docStar}
13081308
* Gets the $public '$alias' alias.

Tests/Dumper/PhpDumperTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,30 @@ public function testWither()
13391339
$wither = $container->get('wither');
13401340
$this->assertInstanceOf(Foo::class, $wither->foo);
13411341
}
1342+
1343+
/**
1344+
* @group legacy
1345+
* @expectedDeprecation The "deprecated1" service alias is deprecated. You should stop using it, as it will be removed in the future.
1346+
* @expectedDeprecation The "deprecated2" service alias is deprecated. You should stop using it, as it will be removed in the future.
1347+
*/
1348+
public function testMultipleDeprecatedAliasesWorking()
1349+
{
1350+
$container = new ContainerBuilder();
1351+
$container->setDefinition('bar', new Definition('stdClass'))->setPublic(true);
1352+
$container->setAlias('deprecated1', 'bar')->setPublic(true)->setDeprecated('%alias_id% is deprecated');
1353+
$container->setAlias('deprecated2', 'bar')->setPublic(true)->setDeprecated('%alias_id% is deprecated');
1354+
$container->compile();
1355+
1356+
$dumper = new PhpDumper($container);
1357+
$dump = $dumper->dump(['class' => $class = __FUNCTION__]);
1358+
1359+
eval('?>'.$dump);
1360+
$container = new $class();
1361+
1362+
$this->assertInstanceOf(\stdClass::class, $container->get('bar'));
1363+
$this->assertInstanceOf(\stdClass::class, $container->get('deprecated1'));
1364+
$this->assertInstanceOf(\stdClass::class, $container->get('deprecated2'));
1365+
}
13421366
}
13431367

13441368
class Rot13EnvVarProcessor implements EnvVarProcessorInterface

0 commit comments

Comments
 (0)