Skip to content

Commit b6f2ea6

Browse files
authored
[11.x] Fix symfony/console:7.4 compatibility (#56015)
Symfony Console deprecate `add()` method and instead calls `addCommand()` method from `addCommands()`. This cause the application not to have the correct instance of `$laravel` property. PR: <symfony/symfony#60394> Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
1 parent 49dd2f5 commit b6f2ea6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Illuminate/Console/Application.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,20 @@ public function output()
206206
: '';
207207
}
208208

209+
/**
210+
* Add an array of commands to the console.
211+
*
212+
* @param array<int, \Symfony\Component\Console\Command\Command> $commands
213+
* @return void
214+
*/
215+
#[\Override]
216+
public function addCommands(array $commands): void
217+
{
218+
foreach ($commands as $command) {
219+
$this->add($command);
220+
}
221+
}
222+
209223
/**
210224
* Add a command to the console.
211225
*

0 commit comments

Comments
 (0)