Issue #3233456 by daffie, longwave: [Symfony 6] Add "int" type hint to methods overriding Symfony\Component\Console\Command\Command::execute()
parent
954f80a5f3
commit
30eb18c5ad
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue