Webmozart\Console\Api\Args\Format\ArgsFormatBuilder::setCommandNames PHP Method

setCommandNames() public method

Sets the command names of the built format.
public setCommandNames ( array $commandNames ) : static
$commandNames array The command names.
return static The current instance.
    public function setCommandNames(array $commandNames)
    {
        $this->commandNames = array();
        $this->addCommandNames($commandNames);
        return $this;
    }

Usage Example

 public function testSetCommandNames()
 {
     $this->builder->addCommandName($cluster = new CommandName('cluster'));
     $this->builder->setCommandNames(array($server = new CommandName('server'), $add = new CommandName('add')));
     $this->assertSame(array($server, $add), $this->builder->getCommandNames());
 }