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

Commit5f38554

Browse files
committed
[TASK] Adapt for upcoming Symfony 5.3 command tag properties
With the Symfony PRsymfony/symfony#39851new depndency injection console.command tag properties aresupported, which allow to inject the description andthe hidden state into console commands.In order to maintain a consistent console.command DI tag syntaxbetween Symfony and TYPO3 core, we now add forward compatibilityfor this change.Releases: master, 10.4Resolves: #93425Related: #93174Change-Id: Ie5dac65deaede2099f2d337466295bd2815ce918Reviewed-on:https://review.typo3.org/c/Packages/TYPO3.CMS/+/67639Tested-by: TYPO3com <noreply@typo3.com>Tested-by: Helmut Hummel <typo3@helhum.io>Tested-by: Benni Mack <benni@typo3.org>Tested-by: Benjamin Franzke <bfr@qbus.de>Reviewed-by: Helmut Hummel <typo3@helhum.io>Reviewed-by: Benni Mack <benni@typo3.org>Reviewed-by: Benjamin Franzke <bfr@qbus.de>
1 parentc322f43 commit5f38554

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎Classes/DependencyInjection/ConsoleCommandPass.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ public function process(ContainerBuilder $container)
5252
foreach ($container->findTaggedServiceIds($this->tagName)as$serviceName =>$tags) {
5353
$commandServiceDefinition =$container->findDefinition($serviceName)->setPublic(true);
5454
$commandName =null;
55+
$description =null;
56+
$hidden =false;
5557
$aliases = [];
5658
foreach ($tagsas$attributes) {
5759
if (!isset($attributes['command'])) {
5860
continue;
5961
}
62+
$description =$attributes['description'] ??$description;
63+
$hidden = (bool)($attributes['hidden'] ??$hidden);
6064
$commandRegistryDefinition->addMethodCall('addLazyCommand', [
6165
$attributes['command'],
6266
$serviceName,
@@ -70,6 +74,12 @@ public function process(ContainerBuilder $container)
7074
}
7175
}
7276
$commandServiceDefinition->addMethodCall('setName', [$commandName]);
77+
if ($description) {
78+
$commandServiceDefinition->addMethodCall('setDescription', [$description]);
79+
}
80+
if ($hidden) {
81+
$commandServiceDefinition->addMethodCall('setHidden', [true]);
82+
}
7383
if ($aliases) {
7484
$commandServiceDefinition->addMethodCall('setAliases', [$aliases]);
7585
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp