DevelUuidCommand.php

Same filename in this branch
  1. 5.x src/Drush/Commands/DevelUuidCommand.php

Namespace

Drupal\devel\Command

File

src/Command/DevelUuidCommand.php

View source
<?php

declare (strict_types=1);
namespace Drupal\devel\Command;

use Drupal\Component\Uuid\UuidInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Generates a UUID.
 */
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;
  }

}

Classes

Title Deprecated Summary
DevelUuidCommand Generates a UUID.