Issue #3233456 by daffie, longwave: [Symfony 6] Add "int" type hint to methods overriding Symfony\Component\Console\Command\Command::execute()

merge-requests/1294/head^2
catch 2021-12-13 12:45:57 +00:00
parent 954f80a5f3
commit 30eb18c5ad
13 changed files with 13 additions and 13 deletions

View File

@ -47,7 +47,7 @@ EOT
/**
* {@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;

View File

@ -48,7 +48,7 @@ class DbDumpCommand extends DbCommandBase {
/**
* {@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.

View File

@ -32,7 +32,7 @@ class DbImportCommand extends DbCommandBase {
/**
* {@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.');

View File

@ -50,7 +50,7 @@ class GenerateProxyClassCommand extends Command {
/**
* {@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');

View File

@ -51,7 +51,7 @@ class GenerateTheme extends Command {
/**
* {@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.

View File

@ -60,7 +60,7 @@ class InstallCommand extends Command {
/**
* {@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.');

View File

@ -44,7 +44,7 @@ class QuickStartCommand extends Command {
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output) {
protected function execute(InputInterface $input, OutputInterface $output): int {
$command = $this->getApplication()->find('install');
$arguments = [

View File

@ -58,7 +58,7 @@ class ServerCommand extends Command {
/**
* {@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');

View File

@ -129,7 +129,7 @@ class DbCommandBaseTester extends DbCommandBase {
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output) {
protected function execute(InputInterface $input, OutputInterface $output): int {
// Empty implementation for testing.
return 0;
}

View File

@ -81,7 +81,7 @@ class TestSiteInstallCommand extends Command {
/**
* {@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);

View File

@ -29,7 +29,7 @@ class TestSiteReleaseLocksCommand extends Command {
/**
* {@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;

View File

@ -37,7 +37,7 @@ class TestSiteTearDownCommand extends Command {
/**
* {@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 {

View File

@ -41,7 +41,7 @@ class TestSiteUserLoginCommand extends Command {
*
* @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);