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

Breadcrumb

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

function Command::setName

Sets the name of the command.

This method can set both the namespace and the name if you separate them by a colon (:)

$command->setName('foo:bar');

Return value

$this

Throws

InvalidArgumentException When the name is invalid

2 calls to Command::setName()
Command::__construct in vendor/symfony/console/Command/Command.php
SingleCommandApplication::run in vendor/symfony/console/SingleCommandApplication.php
Runs the command.

File

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

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

public function setName(string $name) : static {
    $this->validateName($name);
    $this->name = $name;
    return $this;
}

API Navigation

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