Skip to content

Commit fc53854

Browse files
Valmonzonicolas-grekas
authored andcommitted
[FrameworkBundle] Allow using their name without added suffix when using #[Target] for custom services
1 parent 7e7dc61 commit fc53854

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
7.4
55
---
66

7+
* Allow using their name without added suffix when using `#[Target]` for custom services
78
* Deprecate `Symfony\Bundle\FrameworkBundle\Console\Application::add()` in favor of `Symfony\Bundle\FrameworkBundle\Console\Application::addCommand()`
89
* Add `assertEmailAddressNotContains()` to the `MailerAssertionsTrait`
910

DependencyInjection/FrameworkExtension.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,7 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co
14261426
->addTag('assets.package', ['package' => $name]);
14271427
$container->setDefinition('assets._package_'.$name, $packageDefinition);
14281428
$container->registerAliasForArgument('assets._package_'.$name, PackageInterface::class, $name.'.package');
1429+
$container->registerAliasForArgument('assets._package_'.$name, PackageInterface::class, $name);
14291430
}
14301431
}
14311432

@@ -2247,6 +2248,7 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
22472248
$container->setAlias(LockFactory::class, new Alias('lock.factory', false));
22482249
} else {
22492250
$container->registerAliasForArgument('lock.'.$resourceName.'.factory', LockFactory::class, $resourceName.'.lock.factory');
2251+
$container->registerAliasForArgument('lock.'.$resourceName.'.factory', LockFactory::class, $resourceName);
22502252
}
22512253
}
22522254
}
@@ -2282,6 +2284,7 @@ private function registerSemaphoreConfiguration(array $config, ContainerBuilder
22822284
$container->setAlias(SemaphoreFactory::class, new Alias('semaphore.factory', false));
22832285
} else {
22842286
$container->registerAliasForArgument('semaphore.'.$resourceName.'.factory', SemaphoreFactory::class, $resourceName.'.semaphore.factory');
2287+
$container->registerAliasForArgument('semaphore.'.$resourceName.'.factory', SemaphoreFactory::class, $resourceName);
22852288
}
22862289
}
22872290
}
@@ -3307,7 +3310,8 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde
33073310

33083311
if (interface_exists(RateLimiterFactoryInterface::class)) {
33093312
$container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter');
3310-
$factoryAlias->setDeprecated('symfony/dependency-injection', '7.3', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.');
3313+
$container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name);
3314+
$factoryAlias->setDeprecated('symfony/framework-bundle', '7.3', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.');
33113315
}
33123316
}
33133317

0 commit comments

Comments
 (0)