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

hasCommandNames() public method

Returns whether the format contains any command names.
public hasCommandNames ( boolean $includeBase = true ) : boolean
$includeBase boolean Whether to consider command names in the base format.
return boolean Returns `true` if the format contains command names and `false` otherwise.
    public function hasCommandNames($includeBase = true)
    {
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');
        if (count($this->commandNames) > 0) {
            return true;
        }
        if ($includeBase && $this->baseFormat) {
            return $this->baseFormat->hasCommandNames();
        }
        return false;
    }

Usage Example

コード例 #1
0
 /**
  * Returns whether the builder contains any command names.
  *
  * @param bool $includeBase Whether to consider command names of the base
  *                          format.
  *
  * @return bool Returns `true` if the builder contains any command names and
  *              `false` otherwise.
  */
 public function hasCommandNames($includeBase = true)
 {
     Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');
     if (count($this->commandNames) > 0) {
         return true;
     }
     if ($includeBase && $this->baseFormat) {
         return $this->baseFormat->hasCommandNames();
     }
     return false;
 }
All Usage Examples Of Webmozart\Console\Api\Args\Format\ArgsFormat::hasCommandNames