You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+76-30Lines changed: 76 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -53,18 +53,29 @@ class Command
53
53
privatearray$synopsis = [];
54
54
privatearray$usages = [];
55
55
private ?HelperSet$helperSet = null;
56
+
privatebool$initialized = false;
56
57
58
+
/**
59
+
* @deprecated since Symfony 7.3
60
+
*/
57
61
publicstaticfunctiongetDefaultName(): ?string
58
62
{
63
+
trigger_deprecation('symfony/console', '7.3', 'The static method "%s()" is deprecated and will be removed in Symfony 8.0, extract the command name from the "%s" attribute instead.', __METHOD__, AsCommand::class);
64
+
59
65
if ($attribute = (new \ReflectionClass(static::class))->getAttributes(AsCommand::class)) {
trigger_deprecation('symfony/console', '7.3', 'The static method "%s()" is deprecated and will be removed in Symfony 8.0, extract the command description from the "%s" attribute instead.', __METHOD__, AsCommand::class);
78
+
68
79
if ($attribute = (new \ReflectionClass(static::class))->getAttributes(AsCommand::class)) {
69
80
return$attribute[0]->newInstance()->description;
70
81
}
@@ -79,36 +90,7 @@ public static function getDefaultDescription(): ?string
$definition = $this->definition ?? thrownewLogicException(\sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class));
389
377
390
378
if ($this->code && !$definition->getArguments() && !$definition->getOptions()) {
@@ -407,6 +395,8 @@ public function getNativeDefinition(): InputDefinition
0 commit comments