ConsoleSubExampleCommand.php

Same filename and directory in other branches
  1. 11.x core/modules/system/tests/modules/console_test/src/Command/Sub/ConsoleSubExampleCommand.php

Namespace

Drupal\console_test\Command\Sub

File

core/modules/system/tests/modules/console_test/src/Command/Sub/ConsoleSubExampleCommand.php

View source
<?php

declare (strict_types=1);
namespace Drupal\console_test\Command\Sub;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

/**
 * An example command in a subdirectory.
 *
 * @internal
 */
class ConsoleSubExampleCommand extends Command {
  
  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) : int {
    $io = new SymfonyStyle($input, $output);
    $io->success('Done.');
    return Command::SUCCESS;
  }

}

Classes

Title Deprecated Summary
ConsoleSubExampleCommand An example command in a subdirectory.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.