class DevelUuidCommand

Same name in this branch
  1. 5.x src/Drush/Commands/DevelUuidCommand.php \Drupal\devel\Drush\Commands\DevelUuidCommand

Generates a UUID.

Attributes

#[AsCommand(name: self::NAME, description: 'Generate a Universally Unique Identifier (UUID).', aliases: [ 'uuid', 'devel-uuid', ])]

Hierarchy

Expanded class hierarchy of DevelUuidCommand

2 files declare their use of DevelUuidCommand
DevelCommandsKernelTest.php in tests/src/Kernel/DevelCommandsKernelTest.php
DevelUuidCommand.php in src/Drush/Commands/DevelUuidCommand.php

File

src/Command/DevelUuidCommand.php, line 15

Namespace

Drupal\devel\Command
View source
class DevelUuidCommand {
  public const NAME = 'devel:uuid';
  public function __construct(protected readonly UuidInterface $uuid) {
  }
  
  /**
   * Prints a new UUID.
   */
  public function __invoke(OutputInterface $output) : int {
    $output->writeln($this->uuid
      ->generate());
    return Command::SUCCESS;
  }

}

Members

Title Sort descending Modifiers Object type Summary
DevelUuidCommand::NAME public constant
DevelUuidCommand::__construct public function
DevelUuidCommand::__invoke public function Prints a new UUID.