Skip to content

Commit 501d337

Browse files
Merge branch '5.0'
* 5.0: [Routing] fix tests [DI] minor cleanup [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 Allow PHP ^7.2.5 States that the HttpClient provides a Http Async implementation [Routing] Fix ContainerLoader and ObjectLoaderTest [HttpKernel] Make ErrorListener::onKernelException()'s dispatcher argument explicit [HttpKernel] Drop deprecated ExceptionListener Removed extra whitespace [Security] Fix best encoder not wired using migrate_from
2 parents c3601b0 + cdaee34 commit 501d337

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

Definition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public function addMethodCall(string $method, array $arguments = [], bool $retur
357357
if (empty($method)) {
358358
throw new InvalidArgumentException('Method name cannot be empty.');
359359
}
360-
$this->calls[] = 2 < \func_num_args() && func_get_arg(2) ? [$method, $arguments, true] : [$method, $arguments];
360+
$this->calls[] = $returnsClone ? [$method, $arguments, true] : [$method, $arguments];
361361

362362
return $this;
363363
}

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.9",
19+
"php": "^7.2.5",
2020
"psr/container": "^1.0",
2121
"symfony/service-contracts": "^1.1.6|^2"
2222
},

0 commit comments

Comments
 (0)