From 30eb18c5adc50cbfe3a96533e36eed20d631f1bc Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Mon, 13 Dec 2021 12:45:57 +0000 Subject: [PATCH] Issue #3233456 by daffie, longwave: [Symfony 6] Add "int" type hint to methods overriding Symfony\Component\Console\Command\Command::execute() --- composer/Plugin/Scaffold/ComposerScaffoldCommand.php | 2 +- core/lib/Drupal/Core/Command/DbDumpCommand.php | 2 +- core/lib/Drupal/Core/Command/DbImportCommand.php | 2 +- core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php | 2 +- core/lib/Drupal/Core/Command/GenerateTheme.php | 2 +- core/lib/Drupal/Core/Command/InstallCommand.php | 2 +- core/lib/Drupal/Core/Command/QuickStartCommand.php | 2 +- core/lib/Drupal/Core/Command/ServerCommand.php | 2 +- .../system/tests/src/Kernel/Scripts/DbCommandBaseTest.php | 2 +- core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php | 2 +- .../Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php | 2 +- core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php | 2 +- .../tests/Drupal/TestSite/Commands/TestSiteUserLoginCommand.php | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/composer/Plugin/Scaffold/ComposerScaffoldCommand.php b/composer/Plugin/Scaffold/ComposerScaffoldCommand.php index 6de8aa4bf8fc..c1b34ca503b6 100644 --- a/composer/Plugin/Scaffold/ComposerScaffoldCommand.php +++ b/composer/Plugin/Scaffold/ComposerScaffoldCommand.php @@ -47,7 +47,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $handler = new Handler($this->getComposer(), $this->getIO()); $handler->scaffold(); return 0; diff --git a/core/lib/Drupal/Core/Command/DbDumpCommand.php b/core/lib/Drupal/Core/Command/DbDumpCommand.php index a36366cc2eb9..c1b467289546 100644 --- a/core/lib/Drupal/Core/Command/DbDumpCommand.php +++ b/core/lib/Drupal/Core/Command/DbDumpCommand.php @@ -48,7 +48,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $connection = $this->getDatabaseConnection($input); // If not explicitly set, disable ANSI which will break generated php. diff --git a/core/lib/Drupal/Core/Command/DbImportCommand.php b/core/lib/Drupal/Core/Command/DbImportCommand.php index 4765692168f3..cf461df7346f 100644 --- a/core/lib/Drupal/Core/Command/DbImportCommand.php +++ b/core/lib/Drupal/Core/Command/DbImportCommand.php @@ -32,7 +32,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $script = $input->getArgument('script'); if (!is_file($script)) { $output->writeln('File must exist.'); diff --git a/core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php b/core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php index ac99bc6c3a4f..0dc481c63597 100644 --- a/core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php +++ b/core/lib/Drupal/Core/Command/GenerateProxyClassCommand.php @@ -50,7 +50,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $class_name = ltrim($input->getArgument('class_name'), '\\'); $namespace_root = $input->getArgument('namespace_root_path'); diff --git a/core/lib/Drupal/Core/Command/GenerateTheme.php b/core/lib/Drupal/Core/Command/GenerateTheme.php index fbfebbf2d17e..9da8af0386d6 100644 --- a/core/lib/Drupal/Core/Command/GenerateTheme.php +++ b/core/lib/Drupal/Core/Command/GenerateTheme.php @@ -51,7 +51,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); // Change the directory to the Drupal root. diff --git a/core/lib/Drupal/Core/Command/InstallCommand.php b/core/lib/Drupal/Core/Command/InstallCommand.php index 4b76025c11d1..2e73df37962d 100644 --- a/core/lib/Drupal/Core/Command/InstallCommand.php +++ b/core/lib/Drupal/Core/Command/InstallCommand.php @@ -60,7 +60,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); if (!extension_loaded('pdo_sqlite')) { $io->getErrorStyle()->error('You must have the pdo_sqlite PHP extension installed. See core/INSTALL.sqlite.txt for instructions.'); diff --git a/core/lib/Drupal/Core/Command/QuickStartCommand.php b/core/lib/Drupal/Core/Command/QuickStartCommand.php index 690b20eb3b26..572f6415c20f 100644 --- a/core/lib/Drupal/Core/Command/QuickStartCommand.php +++ b/core/lib/Drupal/Core/Command/QuickStartCommand.php @@ -44,7 +44,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $command = $this->getApplication()->find('install'); $arguments = [ diff --git a/core/lib/Drupal/Core/Command/ServerCommand.php b/core/lib/Drupal/Core/Command/ServerCommand.php index 6c153241b2d9..09559db2aafa 100644 --- a/core/lib/Drupal/Core/Command/ServerCommand.php +++ b/core/lib/Drupal/Core/Command/ServerCommand.php @@ -58,7 +58,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $host = $input->getOption('host'); diff --git a/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php b/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php index cef2414ec001..5f29d4ed3f63 100644 --- a/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php +++ b/core/modules/system/tests/src/Kernel/Scripts/DbCommandBaseTest.php @@ -129,7 +129,7 @@ public function getDatabaseConnection(InputInterface $input) { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { // Empty implementation for testing. return 0; } diff --git a/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php b/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php index fb92ee8ec1be..e9d4349483a5 100644 --- a/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php +++ b/core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php @@ -81,7 +81,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { // Determines and validates the setup class prior to installing a database // to avoid creating unnecessary sites. $root = dirname(__DIR__, 5); diff --git a/core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php b/core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php index d0378779642a..c88abb84ab18 100644 --- a/core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php +++ b/core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php @@ -29,7 +29,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { TestDatabase::releaseAllTestLocks(); $output->writeln('<info>Successfully released all the test database locks</info>'); return 0; diff --git a/core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php b/core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php index 0eff01cedf1a..a2b5f54e3203 100644 --- a/core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php +++ b/core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php @@ -37,7 +37,7 @@ protected function configure() { /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $db_prefix = $input->getArgument('db-prefix'); // Validate the db_prefix argument. try { diff --git a/core/tests/Drupal/TestSite/Commands/TestSiteUserLoginCommand.php b/core/tests/Drupal/TestSite/Commands/TestSiteUserLoginCommand.php index cb8c119d5af5..6ea3395ea538 100644 --- a/core/tests/Drupal/TestSite/Commands/TestSiteUserLoginCommand.php +++ b/core/tests/Drupal/TestSite/Commands/TestSiteUserLoginCommand.php @@ -41,7 +41,7 @@ protected function configure() { * * @throws \Symfony\Component\Console\Exception\InvalidArgumentException */ - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $root = dirname(__DIR__, 5); chdir($root); -- GitLab