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

hasCommandOptions() public method

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

Usage Example

Ejemplo n.º 1
0
 /**
  * Returns whether the builder contains any command options.
  *
  * @param bool $includeBase Whether to include command  options in the base
  *                          format in the search.
  *
  * @return bool Returns `true` if the builder contains command options and
  *              `false` otherwise.
  */
 public function hasCommandOptions($includeBase = true)
 {
     Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');
     if (count($this->commandOptions) > 0) {
         return true;
     }
     if ($includeBase && $this->baseFormat) {
         return $this->baseFormat->hasCommandOptions();
     }
     return false;
 }
All Usage Examples Of Webmozart\Console\Api\Args\Format\ArgsFormat::hasCommandOptions