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: UPGRADE-7.0.md
+7
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,13 @@ Symfony 6.4 and Symfony 7.0 will be released simultaneously at the end of Novemb
5
5
release process, both versions will have the same features, but Symfony 7.0 won't include any deprecated features.
6
6
To upgrade, make sure to resolve all deprecation notices.
7
7
8
+
Console
9
+
-------
10
+
11
+
* Remove `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead
12
+
* Passing null to `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()` and `Question::setAutocompleterCallback/setValidator()` must be done explicitly
trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', get_debug_type($command));
$this->signalRegistry->register($signal, function (int$signal) use ($command): void {
1048
-
$exitCode = $command->handleSignal($signal);
1049
-
// BC layer for Symfony <= 5
1050
-
if (null === $exitCode) {
1051
-
trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', get_debug_type($command));
1052
-
$exitCode = 0;
1053
-
}
1054
-
1055
-
if (false !== $exitCode) {
1043
+
if (false !== $exitCode = $command->handleSignal($signal)) {
Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/CHANGELOG.md
+7
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,13 @@
1
1
CHANGELOG
2
2
=========
3
3
4
+
7.0
5
+
---
6
+
7
+
* Remove `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead
8
+
* Passing null to `*Command::setApplication()`, `*FormatterStyle::setForeground/setBackground()`, `Helper::setHelpSet()`, `Input*::setDefault()` and `Question::setAutocompleterCallback/setValidator()` must be done explicitly
Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+7-52
Original file line number
Diff line number
Diff line change
@@ -39,20 +39,6 @@ class Command
39
39
publicconstFAILURE = 1;
40
40
publicconstINVALID = 2;
41
41
42
-
/**
43
-
* @var string|null The default command name
44
-
*
45
-
* @deprecated since Symfony 6.1, use the AsCommand attribute instead
46
-
*/
47
-
protectedstatic$defaultName;
48
-
49
-
/**
50
-
* @var string|null The default command description
51
-
*
52
-
* @deprecated since Symfony 6.1, use the AsCommand attribute instead
53
-
*/
54
-
protectedstatic$defaultDescription;
55
-
56
42
private ?Application$application = null;
57
43
private ?string$name = null;
58
44
private ?string$processTitle = null;
@@ -70,40 +56,20 @@ class Command
70
56
71
57
publicstaticfunctiongetDefaultName(): ?string
72
58
{
73
-
$class = static::class;
74
-
75
-
if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) {
59
+
if ($attribute = (new \ReflectionClass(static::class))->getAttributes(AsCommand::class)) {
76
60
return$attribute[0]->newInstance()->name;
77
61
}
78
62
79
-
$r = new \ReflectionProperty($class, 'defaultName');
80
-
81
-
if ($class !== $r->class || null === static::$defaultName) {
82
-
returnnull;
83
-
}
84
-
85
-
trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultName" for setting a command name is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class);
if ($attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) {
68
+
if ($attribute = (new \ReflectionClass(static::class))->getAttributes(AsCommand::class)) {
95
69
return$attribute[0]->newInstance()->description;
96
70
}
97
71
98
-
$r = new \ReflectionProperty($class, 'defaultDescription');
99
-
100
-
if ($class !== $r->class || null === static::$defaultDescription) {
101
-
returnnull;
102
-
}
103
-
104
-
trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultDescription" for setting a command description is deprecated. Add the "%s" attribute to the "%s" class instead.', AsCommand::class, static::class);
105
-
106
-
returnstatic::$defaultDescription;
72
+
returnnull;
107
73
}
108
74
109
75
/**
@@ -152,11 +118,8 @@ public function ignoreValidationErrors()
0 commit comments