function ConsoleExampleCommand::__construct

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/console_test/src/Command/ConsoleExampleCommand.php \Drupal\console_test\Command\ConsoleExampleCommand::__construct()

Constructs a command with autowiring.

File

core/modules/system/tests/modules/console_test/src/Command/ConsoleExampleCommand.php, line 32

Class

ConsoleExampleCommand
An example command.

Namespace

Drupal\console_test\Command

Code

public function __construct(protected readonly TestService $testService, #[Autowire(service: 'logger.channel.default')] protected LoggerInterface $logger) {
  parent::__construct();
}

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