Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Command.php

function Command::validateName

Validates a command name.

It must be non-empty and parts can optionally be separated by ":".

Throws

InvalidArgumentException When the name is invalid

2 calls to Command::validateName()
Command::setAliases in vendor/symfony/console/Command/Command.php
Sets the aliases for the command.
Command::setName in vendor/symfony/console/Command/Command.php
Sets the name of the command.

File

vendor/symfony/console/Command/Command.php, line 658

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

private function validateName(string $name) : void {
    if (!preg_match('/^[^\\:]++(\\:[^\\:]++)*$/', $name)) {
        throw new InvalidArgumentException(\sprintf('Command name "%s" is invalid.', $name));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal