Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit528572b

Browse files
committed
minor#17565 [DependencyInjection] simplify the BC layer (xabbuh)
This PR was merged into the 2.7 branch.Discussion----------[DependencyInjection] simplify the BC layer| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |The change to the `setFactoryService()` method is consistent with whatwe did with the `getFactoryService()` before (and how we handle thedeprecation of strict references in Symfony 2.8).Commits-------6cd5ee3 [DependencyInjection] simplify the BC layer
2 parents2ef46b3 +6cd5ee3 commit528572b

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

‎src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ public function process(ContainerBuilder $container)
4444
$definition->setMethodCalls($this->processArguments($definition->getMethodCalls()));
4545
$definition->setProperties($this->processArguments($definition->getProperties()));
4646
$definition->setFactory($this->processFactory($definition->getFactory()));
47-
48-
if (null !==$factoryService =$definition->getFactoryService(false)) {
49-
$definition->setFactoryService($this->processFactoryService($factoryService));
50-
}
47+
$definition->setFactoryService($this->processFactoryService($definition->getFactoryService(false)),false);
5148
}
5249

5350
foreach ($container->getAliases()as$id =>$alias) {

‎src/Symfony/Component/DependencyInjection/Definition.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,11 @@ public function getFactoryMethod($triggerDeprecationError = true)
194194
*
195195
* @deprecated since version 2.6, to be removed in 3.0.
196196
*/
197-
publicfunctionsetFactoryService($factoryService)
197+
publicfunctionsetFactoryService($factoryService,$triggerDeprecationError =true)
198198
{
199-
@trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.',__METHOD__,$factoryService),E_USER_DEPRECATED);
199+
if ($triggerDeprecationError) {
200+
@trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.',__METHOD__,$factoryService),E_USER_DEPRECATED);
201+
}
200202

201203
$this->factoryService =$factoryService;
202204

‎src/Symfony/Component/DependencyInjection/DefinitionDecorator.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function setFactoryMethod($method)
9999
/**
100100
* {@inheritdoc}
101101
*/
102-
publicfunctionsetFactoryService($service)
102+
publicfunctionsetFactoryService($service,$triggerDeprecationError =true)
103103
{
104104
$this->changes['factory_service'] =true;
105105

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp