Commit aeb15638 authored by catch's avatar catch
Browse files

Issue #3259026 by longwave, daffie: [Symfony 6] Add return types to Symfony...

Issue #3259026 by longwave, daffie: [Symfony 6] Add return types to Symfony Console application methods
parent 375f5f2d
Loading
Loading
Loading
Loading
+4 −3
Changes for core/lib/Drupal/Core/Command/DbDumpApplication.php: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Drupal\Core\Command;

use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;

/**
@@ -13,14 +14,14 @@ class DbDumpApplication extends Application {
  /**
   * {@inheritdoc}
   */
  protected function getCommandName(InputInterface $input) {
  protected function getCommandName(InputInterface $input): ?string {
    return 'dump-database-d8-mysql';
  }

  /**
   * {@inheritdoc}
   */
  protected function getDefaultCommands() {
  protected function getDefaultCommands(): array {
    // Even though this is a single command, keep the HelpCommand (--help).
    $default_commands = parent::getDefaultCommands();
    $default_commands[] = new DbDumpCommand();
@@ -33,7 +34,7 @@ protected function getDefaultCommands() {
   * Overridden so the application doesn't expect the command name as the first
   * argument.
   */
  public function getDefinition() {
  public function getDefinition(): InputDefinition {
    $definition = parent::getDefinition();
    // Clears the normal first argument (the command name).
    $definition->setArguments();
+1 −1
Changes for core/lib/Drupal/Core/Command/DbToolsApplication.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ public function __construct() {
  /**
   * {@inheritdoc}
   */
  protected function getDefaultCommands() {
  protected function getDefaultCommands(): array {
    $default_commands = parent::getDefaultCommands();
    $default_commands[] = new DbDumpCommand();
    $default_commands[] = new DbImportCommand();
+4 −3
Changes for core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

use Drupal\Component\ProxyBuilder\ProxyBuilder;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;

/**
@@ -33,14 +34,14 @@ public function __construct(ProxyBuilder $proxy_builder) {
  /**
   * {@inheritdoc}
   */
  protected function getCommandName(InputInterface $input) {
  protected function getCommandName(InputInterface $input): ?string {
    return 'generate-proxy-class';
  }

  /**
   * {@inheritdoc}
   */
  protected function getDefaultCommands() {
  protected function getDefaultCommands(): array {
    // Even though this is a single command, keep the HelpCommand (--help).
    $default_commands = parent::getDefaultCommands();
    $default_commands[] = new GenerateProxyClassCommand($this->proxyBuilder);
@@ -53,7 +54,7 @@ protected function getDefaultCommands() {
   * Overridden so the application doesn't expect the command name as the first
   * argument.
   */
  public function getDefinition() {
  public function getDefinition(): InputDefinition {
    $definition = parent::getDefinition();
    // Clears the normal first argument (the command name).
    $definition->setArguments();
+1 −1
Changes for core/tests/Drupal/TestSite/TestSiteApplication.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ class TestSiteApplication extends Application {
  /**
   * {@inheritdoc}
   */
  protected function getDefaultCommands() {
  protected function getDefaultCommands(): array {
    $default_commands = parent::getDefaultCommands();
    $default_commands[] = new TestSiteInstallCommand();
    $default_commands[] = new TestSiteTearDownCommand();