Webmozart\Console\Api\Args\Format\ArgsFormat::getCommandNames PHP Method

getCommandNames() public method

Returns the command names.
public getCommandNames ( boolean $includeBase = true ) : CommandName[]
$includeBase boolean Whether to include command names in the base format in the result.
return CommandName[] The command names.
    public function getCommandNames($includeBase = true)
    {
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');
        $commandNames = $this->commandNames;
        if ($includeBase && $this->baseFormat) {
            $commandNames = array_merge($this->baseFormat->getCommandNames(), $commandNames);
        }
        return $commandNames;
    }

Usage Example

Example #1
0
 /**
  * Returns all command names added to the builder.
  *
  * @param bool $includeBase Whether to include command names of the base
  *                          format in the result.
  *
  * @return CommandName[] The command names.
  */
 public function getCommandNames($includeBase = true)
 {
     Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');
     $commandNames = $this->commandNames;
     if ($includeBase && $this->baseFormat) {
         $commandNames = array_merge($this->baseFormat->getCommandNames(), $commandNames);
     }
     return $commandNames;
 }
All Usage Examples Of Webmozart\Console\Api\Args\Format\ArgsFormat::getCommandNames