Skip to content

Commit 90dd429

Browse files
authored
Issue #85: Support symfony/console 8, but also older symfony/console versions. (#86)
1 parent 0f2e81d commit 90dd429

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

commands/web/drupal

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,23 @@ $loader->addPsr4('DrupalCoreDev\\', $composer_root . '/.ddev/core-dev/src/');
4040

4141
$application = new Application('drupal', \Drupal::VERSION);
4242

43-
$application->add(new InstallCommand($loader));
44-
$application->add(new UninstallCommand());
45-
$application->add(new ModuleInstallCommand($loader));
46-
$application->add(new CacheCommand($loader));
47-
$application->add(new AdminLoginCommand($loader));
48-
$application->add(new GenerateTheme());
49-
$application->add(new TestCommand());
50-
$application->add(new TestExtensionsCommand());
51-
$application->add(new TestBrowserCommand());
52-
$application->add(new LintPhpCsCommand());
53-
$application->add(new LintPhpStanCommand());
54-
$application->add(new LintCssCommand());
55-
$application->add(new LintJsCommand());
56-
$application->add(new LintCspellCommand());
57-
$application->add(new LintCommand());
43+
// Use ->addCommands() which works in different versions of symfony/console.
44+
$application->addCommands([
45+
new InstallCommand($loader),
46+
new UninstallCommand(),
47+
new ModuleInstallCommand($loader),
48+
new CacheCommand($loader),
49+
new AdminLoginCommand($loader),
50+
new GenerateTheme(),
51+
new TestCommand(),
52+
new TestExtensionsCommand(),
53+
new TestBrowserCommand(),
54+
new LintPhpCsCommand(),
55+
new LintPhpStanCommand(),
56+
new LintCssCommand(),
57+
new LintJsCommand(),
58+
new LintCspellCommand(),
59+
new LintCommand(),
60+
]);
5861

5962
$application->run();

core-dev/src/Command/AdminLoginCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class AdminLoginCommand extends BootCommand {
1111
/**
1212
* {@inheritdoc}
1313
*/
14-
protected function configure() {
14+
protected function configure(): void {
1515
$this->setName('login')
1616
->setDescription('Generates a one-time login link for User 1');
1717

core-dev/src/Command/CacheCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CacheCommand extends BootCommand {
1010
/**
1111
* {@inheritdoc}
1212
*/
13-
protected function configure() {
13+
protected function configure(): void {
1414
parent::configure();
1515
$this->setName('cache')
1616
->setDescription('Clears all caches and the container registry');

core-dev/src/Command/ModuleInstallCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ModuleInstallCommand extends BootCommand {
1212
/**
1313
* {@inheritdoc}
1414
*/
15-
protected function configure() {
15+
protected function configure(): void {
1616
parent::configure();
1717
$this->setName('module:install')
1818
->setDescription('Install modules')

core-dev/src/Command/TestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TestCommand extends Command {
1414
/**
1515
* {@inheritdoc}
1616
*/
17-
protected function configure() {
17+
protected function configure(): void {
1818
$this->setName('test')
1919
->setDescription('Run all core tests using the run-tests.sh script. You probably don\'t want to do this - instead run PHPUnit directly on selected tests e.g. ddev phpunit core/modules/sdc/tests');
2020

core-dev/src/Command/UninstallCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class UninstallCommand extends Command {
1212
/**
1313
* {@inheritdoc}
1414
*/
15-
protected function configure() {
15+
protected function configure(): void {
1616
$this->setName('uninstall')
1717
->setDescription('Uninstall Drupal by deleting settings.');
1818
}

0 commit comments

Comments
 (0)