Skip to content

Commit 930d040

Browse files
Merge pull request #92 from kachnitel/fix/symfony-console-7-compat
fix: Add void return type to configure() for Symfony Console 7.x compatibility
2 parents 3d4a53e + c709e90 commit 930d040

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

conventional-changelog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ $commandName = $command->getName();
2828

2929
// Run application single command
3030
$application = new Application('conventional-changelog', '1.17.3');
31-
$application->add($command);
31+
// Symfony Console 8.0+ removed add() in favor of addCommand()
32+
if (method_exists($application, 'addCommand')) {
33+
$application->addCommand($command);
34+
} else {
35+
$application->add($command);
36+
}
3237
$application->setDefaultCommand($commandName, true);
3338
$application->run();

src/DefaultCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(array $settings = [])
5757
*
5858
* @return void
5959
*/
60-
protected function configure()
60+
protected function configure(): void
6161
{
6262
$this
6363
->setDescription("Generate changelogs and release notes from a project's commit messages" .

0 commit comments

Comments
 (0)